-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Add support for dim transforms to set style options #2152
Conversation
I'll be happy to see this supported though I do have one request... I really want to see I want to make sure the simplest uses of Edit: I see a few examples in the notebook you linked to, though a few more examples shown in the comments of this PR wouldn't go amiss! |
I'd also like this PR to address #237. |
How do you think |
I've discussed this before but I was going to suggest an |
I remember discussing |
It wouldn't of course, could be a followup PR. I just wanted to establish a link between |
To track how complete this PR is I'm going to make a list of elements that are fully tested: Elements testedCharts
Geometries
Graphs
Statistics
Not supported (i.e. no vectorized glyphs)
Note that when I something is not supported that means that this property cannot be set as a vectorized property. Therefore to support these cases we would have to plot multiple separate artists/glyphs, which won't be handled in the first iteration of this feature. |
This notebook also tracks what is and isn't supported yet: |
5dd5a7b
to
7ea4993
Compare
So I think we are now in a place where this can be merged, but there are still a few outstanding items which will need to happen in later PRs:
Some other features this PR introduces:
Another idea I've had, is that we could allow specifying a transform(s) directly on a
|
Sounds great! |
Tests should pass shortly. Let's get this merged so we can get a few days of testing in before a release. |
@@ -50,7 +50,7 @@ | |||
"metadata": {}, | |||
"outputs": [], | |||
"source": [ | |||
"violin.options(height=500, width=900)" | |||
"violin.options(height=500, width=900, violin_fill_color=('Year', str), cmap='Set1')" |
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 this is a stray instance of the tuple format...
@@ -53,7 +53,7 @@ | |||
"metadata": {}, | |||
"outputs": [], | |||
"source": [ | |||
"boxwhisker.options(show_legend=False, width=400)" | |||
"boxwhisker.options(show_legend=False, width=600, box_fill_color=('origin', str), cmap='Set1')" |
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.
And another tuple...
I'm happy to merge but I think I spotted a few stray instances of the tuple format above. |
Tests are now green. I'm very happy to merge this PR as I think it will greatly simplify things throughout while exposing a more powerful way of working. It will require a fair bit of testing and of course we may well have various tweaks to make. For the time being, I'll finally go ahead and merge...nearly a year since this PR was first opened! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
As discussed in #768 this PR adds support for scaling various style options by values in the element. It adds an
op
object which allows defining deferred transforms on an element dimension implementing the standard mathematical operations and common NumPy operations.You can see what is currently supported here.
As we had discussed in the issue we will also support tuple and string syntax so you only have to define an
op
to define complex transforms more easily.Here are some example: