-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Make colorbars respect template configurations #1867
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
Conversation
Thanks for the PR!
Is this true of all colorbars or just the |
Hmm, not sure. Could you provide a code test case to run? I saw that |
All the non-PX code here uses "trace-defined" colorbars rather than |
OK so the problem with the example above is that the current builtin templates don't set a colorscale default for |
47378cb
to
cbba6e1
Compare
Ah ok I see. I didn't realize that the colorscale would not work with I reverted all removals, rebased, and force pushed. The current version lets the template modify the colorbars and colorscales of both |
Can you add the colorbar settings to the other traces types too please? even if only the |
Sorry if this isn't clear...
There are two ways to draw a colorbar: "at the trace level" via
something.colorbar attributes on a go.Something (i.e. marker.colorbar in
go.Scatter) or "at the layout level" via layout.coloraxis.colorbar if a
coloraxis is being used.
At the moment, the built-in templates define the colorbar settings (borders
and ticks and so on) at the trace level for certain trace types
(histogram2d, heatmap etc: the ones you had deleted and I had asked you to
undelete). Your PR adds the colorbar settings to the layout level. PX uses
a layout-level colorbar, so this is why PX didn't pick things up before
your PR but does after your PR. This still leaves colorbars that arise from
usage of go.Scatter *without* using PX, i.e. with
`go.Figure(go.Scatter(x=[1,2], y=[1,2], marker_color=[1,2],
marker_showscale=True))` ... in order for such a figure to get the nice
tick labels etc, we'd need to duplicate those lines I had asked you to
undelete, once per trace type that supports a colorbar. Don't worry about
it for now though, this can be added in a future PR.
…On Tue, Nov 5, 2019 at 1:57 PM Joel Ostblom ***@***.***> wrote:
Sorry, I don't understand, can you elaborate on the changes required?
The PR already works with the px.scatter colorbar.
[image: image]
<https://user-images.githubusercontent.com/4560057/68236734-03191280-0006-11ea-8bf0-73c1a968629d.png>
The colorscale is already picked up by go.Scatter so don't think I need
to add that separately as for the heatmaps.
[image: image]
<https://user-images.githubusercontent.com/4560057/68236891-51c6ac80-0006-11ea-9eeb-a268264f4fc3.png>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1867?email_source=notifications&email_token=AABRWA6YKJMS4WUILUHCHGDQSG6ZZA5CNFSM4JIYXS42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDD5SMA#issuecomment-549968176>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRWA3O24KBJWKXTTU6KCTQSG6ZZANCNFSM4JIYXS4Q>
.
--
Nicolas Kruchten - VP Product
e [email protected]
5555 Gaspe Ave #118, Montreal, QC, H2T 2A3
<https://github.com/plotly?utm_source=WiseStamp&utm_medium=email&utm_term=&utm_content=&utm_campaign=signature>
<https://twitter.com/plotlygraphs?utm_source=WiseStamp&utm_medium=email&utm_term=&utm_content=&utm_campaign=signature>
<https://www.instagram.com/plotly?utm_source=WiseStamp&utm_medium=email&utm_term=&utm_content=&utm_campaign=signature>
<https://www.linkedin.com/company/plotly/?utm_source=WiseStamp&utm_medium=email&utm_term=&utm_content=&utm_campaign=signature>
|
Currently, none of the colorbar options in the templates are effective and colorbars are rendered the same regardless of the template. This PR adds the template colorbar options under the
layout.coloraxis
key instead of assigning them to individual figures. As a bonus the json template files are now about half the size.I removed the colorbar helper function because I didn't see any other use for it. I also removed the figure level colorscale assignments because it seems like the figures pick up these from the template just fine.
You can see the effect of the proposed changes below.
========== Current =================== This PR =======