-
Notifications
You must be signed in to change notification settings - Fork 15
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
first draft of geom ribbon #63
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,10 @@ const LineDefaultStyle = Style(lineWidth: 1.0, | |
size: 5.0, # used to draw error bar 'T' horizontal | ||
color: grey20, | ||
fillColor: transparent) | ||
const RibbonDefaultStyle = Style(lineWidth: 1.0, | ||
lineType: ltNone, | ||
color: transparent, | ||
fillColor: grey20) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would propose default With this default grey it would look nice even without alpha. |
||
const BarDefaultStyle = Style(lineWidth: 1.0, | ||
lineType: ltSolid, | ||
color: grey20, | ||
|
@@ -42,6 +46,8 @@ func defaultStyle(geomKind: GeomKind): Style = | |
result = PointDefaultStyle | ||
of gkLine, gkFreqPoly, gkErrorBar: | ||
result = LineDefaultStyle | ||
of gkRibbon: | ||
result = RibbonDefaultStyle | ||
of gkBar: | ||
result = BarDefaultStyle | ||
of gkHistogram: | ||
|
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.
Instead of these changes, I propose the following. We already have
readErrorBar
, which handles xMin, yMin, ... etc. for error bar plots. This is essentially all that's required. Therefore, the code in this proc can remain as is, instead of the blocks from 540 to 580 and line 584 we just write:where
addRibbonData
is a proc you define above:And remove the added changes at the beginning of the proc.
This has the added benefit of also supporting ribbons for
xMin, xMax
too (and even weird combinations, which will result in some funky plots I assume), and instead of adding checks along the lines of only x or y related procs, I'd either add:geom_ribbon
geom_ribbon
that the user should either use this or that.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.
This change requires two small changes in different files.
ggplot_types.nim
you need to extend thegeomKind
field for theFilledGeom
to includegkRibbon
to thegkErrorBar
case, so thatxMin
etc. fields are defined forgkRibbon
.postprocess_scales.nim
infillOptFields
you have to do the same, addgkRibbon
to thegkErrorBar
case so that these fields are actually filled and we don't have to access theaes
of the rawgeom
.