-
Notifications
You must be signed in to change notification settings - Fork 250
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
HBandGeometry and VBandGeometry #1176
HBandGeometry and VBandGeometry #1176
Conversation
2afc163
to
ac1832e
Compare
Codecov Report
@@ Coverage Diff @@
## master #1176 +/- ##
==========================================
- Coverage 93.66% 93.62% -0.05%
==========================================
Files 33 35 +2
Lines 3156 3182 +26
==========================================
+ Hits 2956 2979 +23
- Misses 200 203 +3
Continue to review full report at Codecov.
|
this provides a nice alternate parameterization to {h,v}line, where instead of specifying the intercept and width, you specify the min and max. great to see unit tests. still needs docstrings and a gallery addition. @miguelmorin would you find this useful. thanks for contributing @CiaranOMara . and sorry for the delay getting back to you. it's been a busy summer. |
Seems like a useful generalization of |
Thanks @CiaranOMara, and yes @bjarthur I would find this very useful. |
Thank you all for the feedback. I'll go ahead and develop the docstrings and gallery additions for this pull request. I'll then have a go at making I'm pretty busy this winter, but I hope to make another pull-request in the next 2 weeks. |
This could also perhaps be done as a |
065d91e
to
f7647de
Compare
cf0e97c
to
1f1a5bf
Compare
f41275a
to
953f11c
Compare
953f11c
to
d3a2aa8
Compare
d3a2aa8
to
26a0c40
Compare
Derived from the suggestions and examples of @Mattriks .
Thank you @Mattriks for the advice and examples. It was not immediately apparent to me that I needed to look in statistics.jl. I can see that in general In my implementation of BandStatistic, I decided to allow types of Measure to pass through (see 7eb4f), but I'm not sure this is an agreeable solution. It assumes that the Measure is and will be correct for the render function. |
+100 for a solution which embraces GoG and uses a statistic. why does Theme need to be modified? also, @Mattriks would be great to having something like your post above on how statistics work in the development section of the manual |
Also great to see
@CiaranOMara have you done the regression testing? That is the first test whether your new coding has any side effects! |
Agreed. I think eventually we should have subsections inside of Theme for in-graph positioning, colors, fonts, etc because it would be nice to balance specificity with verbosity of |
@Mattriks no regression testing yet. I'll have access to my Linux box in a few days. My laptop (macOS) is affected by the _jl_libpangocairo issue and I haven't currently got a remote system setup with access. |
I had the chance to run the regression tests to compare this development against the point at which this development forked. There are no differences between the SVGs and PNGs, except where I moved a call to |
Building on an clarifying some of my of my points in relation to @tlnagy's comment.
The render function for The other emergent constituent is the rendering of basic shapes; prominent in this example is the rectangle where the coordinates of its corners specify shape and position. All of the code that parses the coordinates and calls |
this looks great so far. a few suggestions:
|
src/statistics.jl
Outdated
""" | ||
Stat.band[(; orientation=:vertical)] | ||
|
||
Transform points in $(aes2str(input_aesthetics(band()))) into rectangles in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe "pairs of intercepts" instead of "points"?
test/testscripts/hvband.jl
Outdated
|
||
Dp = dataset("ggplot2","presidential")[3:end,:] | ||
De = dataset("ggplot2","economics") | ||
De[:Unemploy] /= 10^3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's great to have nice examples like this that use real data sets in the documentation, but for tests i think it is better to have very simple test cases like in testscripts/rect.jl
. easier to debug if necessary, will execute more quickly, and create smaller files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In hindsight, I entirely agree (16af33c).
Quick comments to the points above: |
in my mind, the BinGeoms are simply shortcuts for a Stat and a PolygonGeom. and when you say rectbin, i think you mean histogram2d, no? rectbin doesn't actually do any binning. |
Rects could easily be polygons too. Lines 93 to 109 in a6fbcaf
If Geom::rect resolved to polygons, we can remove width computations where the user specifies This may be "out there", and I certainly do not claim to know Gadfly "inside out", my intuition is that the Compose::polygon format is more useful than the Compose::rectangle. The points that define the polygon can be easily manipulated by mathematical transformations, to scale, rotate, reflect or even skew the shape. The points that define the polygon could also be projected on to other coordinate systems - admittedly, more points would need to be added on the paths between specified points to approximate curves. |
65d46a6
to
d97bc03
Compare
# Conflicts: # src/coord.jl # src/statistics.jl
d97bc03
to
78170c1
Compare
This feature provides hband and vband geometries that address a need similar to that expressed in #1174.
Contributor checklist:
NEWS.md
squash
'ed orfixup
'ed junk commits with git-rebaseProposed changes