Skip to content
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

coloraxis1 not matching coloraxis #3892

Closed
nicolaskruchten opened this issue May 23, 2019 · 7 comments
Closed

coloraxis1 not matching coloraxis #3892

nicolaskruchten opened this issue May 23, 2019 · 7 comments
Labels
bug something broken

Comments

@nicolaskruchten
Copy link
Contributor

In this codepen, the colorbar doesn't show: https://codepen.io/nicolaskruchten/pen/BeJgWL

If I change marker.coloraxis = "coloraxis1" to marker.coloraxis = "coloraxis" it does. Even if I set layout.coloraxis1 = {showscale: true} it doesn't.

@nicolaskruchten nicolaskruchten added the bug something broken label May 23, 2019
@alexcjohnson
Copy link
Collaborator

There seem to be others that don't support a 1 suffix - ternary1 fails https://codepen.io/alexcjohnson/pen/KLZjrR, and from the looks of it so will geo1, mapbox1, polar1...

The way we're handling this right now - cleanLayout and cleanData mutating the input figure to strip these 1's - doesn't seem like it has an easy way to enforce that we add this behavior every time a new attribute & container following this counting pattern is added. Nor do we really want to be mutating the input figure.

What if we changed this logic to happen in supplyDefaults instead?

  • coerce '<prefix>1' into '<prefix>' for such attributes & containers. Ignore container '<prefix>1' if '<prefix>' also exists.
  • keep track of what the input container was named so that restyle/relayout calls can target the correct input container.

Would be a bit of a project, but is there any more complexity to it than that?

@nicolaskruchten
Copy link
Contributor Author

huh. Plotly.py's codegen logic I think assumes this works everywhere. @jonmmease ?

@jonmmease
Copy link
Contributor

@nicolaskruchten, plotly.py should be the one doing the translation of coloraxis1 to coloraxis. At least this is how it works for the rest of the subplot types. I'm guessing that we (and by that I mean I 🙂) missed a hard-coded list of subplot types somewhere in plotly.py. I'll take a look

@nicolaskruchten
Copy link
Contributor Author

OK cool, so this isn't really a big priority. I'd mistaken plotly.py features for plotly.js features ;)

@nicolaskruchten
Copy link
Contributor Author

The Python fix works for me atm. Happy to close this or leave it open for discussion, but not a priority for me at this time :)

@etpinard
Copy link
Contributor

Related #2519

@etpinard
Copy link
Contributor

Merging with #2519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

4 participants