-
Notifications
You must be signed in to change notification settings - Fork 251
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
Fixes #1126 #1175
Fixes #1126 #1175
Conversation
any idea why tests are failing on shapekey? also, given the removal of a field from Theme, we should probably bump the minor version when this is merged. any other breaking changes we want to include in such a release? maybe #1118 ? otherwise, looks great! |
The
In the |
gadfly has 1000+ stars so i think it's important to document breaking changes with a depwarn. they can be removed after a release or two, so the ugliness is only temporary. maybe see #998 |
i think you just need to add |
Still trying to understand how to do this deprecation in a simple way. In order for |
src/theme.jl
Outdated
|
||
isfinite(lowlight_opacity) && Base.depwarn("The keyword argument `lowlight_opacity` has been deprecated, and never worked anyway!", :Theme) | ||
|
||
return Theme(default_color, point_size, point_size_min, point_size_max, point_shapes, line_width, line_style, panel_fill, panel_stroke, panel_opacity, background_color, |
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.
would Theme(default_color==nothing ? nothing : parse_colorant(default_color), ....
work? this is how it's done for the non-deprecated constructor https://github.com/GiovineItalia/Gadfly.jl/blob/master/src/varset.jl#L47
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.
But that's no different then making a new Theme
constructor, in which case the varset constructor for Theme
is obsolete. If the Theme
constructor is coded explicitly then yes it easy to do deprecations. Removing the varset Theme
constructor and making a new constructor should really be done as a separate PR.
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.
i think all we need here is
function Theme(; default_color, point_size, ..., lowlight_opacity, ...)
Base.depwarn(....)
Theme(
default_color==nothing ? nothing : parse_colorant(default_color),
point_size,
...
#skip lowlight_opacity,
...)
end
no need to specify the types, as that will be handled by the varset definition of the Theme object.
Codecov Report
@@ Coverage Diff @@
## master #1175 +/- ##
==========================================
+ Coverage 87.32% 87.33% +<.01%
==========================================
Files 34 34
Lines 4080 4082 +2
==========================================
+ Hits 3563 3565 +2
Misses 517 517
Continue to review full report at Codecov.
|
Added a |
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.
I'm okay with merging these changes now.
next tag will need to be a minor not point release since this introduces a breaking change. |
for some reason this PR is causing a warning, and i don't understand why.
the Theme constructor with the depwarn in it should be equivalent to the code below, but the latter doesn't emit the same warning.
|
I'm pretty sure this has something to do with varset creating a constructor and then the explicit constructor in |
think i've got a fix #1180 |
squash
'ed orfixup
'ed junk commits with git-rebaseProposed changes
This PR (closes #1126):
lowlight_opacity
argument inTheme
, and adds adepwarn
.Geom.ribbon
and shows how to useTheme(lowlight_color=)
to add color transparency toGeom.ribbon
.Theme(lowlight_color=)
forGeom.polygon
. This makes plot 2 below possible:I added this example in the docs under
Stat.density
.