-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Cannot set colorscale in template for some trace types #3100
Comments
Thanks for the report @jonmmease ! The colorscale part can be "fixed" by adding plotly.js/src/components/colorscale/defaults.js Lines 43 to 46 in d340150
where As for the colorbar part, the problem comes from the colorbar defaults call:
where should be enough to fix this, but we should look for other situations where supply-defaults subroutines are called with trace sub-containers. |
Oh awesome, yeah setting |
One more issue here. Setting |
Thanks for pointing out the relayout issue @jonmmease (-> in https://codepen.io/etpinard/pen/gBqqgo) I'm afraid that it points to a bigger problem though. At the moment, colorscales are mutating in the input traces and thus rely on an 'implied edit' (listed here) during Now there are many more attributes (e.g. I'm not sure what the best way forward is. To stop mutating in things in input traces would solve the issue, or do something similar to the new histogram autobin logic, but those are fairly big projects. There might be an easier solution. In the meantime, using |
Thanks for the background @etpinard, Would But in the meantime, a lot of the template information does come through well when switching templates using |
No unfortunately. Only |
In working on developing templates for plotly.py I've found that I'm not able to set the colorscale and colorbar properties in the template for some trace types.
This works as I expect for the
heatmap
trace type. The defualt colorscale of Viridis and the colorbar tick properties are both applied.Pen: https://codepen.io/jonmmease/pen/mzMeMW
But it does not work for the
scatter.marker
colorscale and colorbar.Pen: https://codepen.io/jonmmease/pen/LgjpQG
Note that
scatter.marker.symbol
is being picked up from the template, so I'm pretty sure the template specification is correct, but let me know if I'm missing something.I've noticed this same behavior for other colorscales and colorbars, and I can work through an exhaustive list later today if that's helpful. Thanks!
The text was updated successfully, but these errors were encountered: