Skip to content

Explicitly setting tickmode to array disables tickvals in date axis #4848

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

Closed
nicolaskruchten opened this issue May 20, 2020 · 6 comments · Fixed by #4851
Closed

Explicitly setting tickmode to array disables tickvals in date axis #4848

nicolaskruchten opened this issue May 20, 2020 · 6 comments · Fixed by #4851
Assignees
Labels
bug something broken
Milestone

Comments

@nicolaskruchten
Copy link
Contributor

Initially reported in plotly/plotly.py#2478

This codepen is a bit puzzling: https://codepen.io/nicolaskruchten/pen/MWaZBwa ... I'm explicitly setting tickmode to array and seeing the default tick labels. But if I comment out that tickmode line it does the right thing, even though the schema docs say that this configuration should imply tickmode=array!

@nicolaskruchten nicolaskruchten added the bug something broken label May 20, 2020
@archmoj
Copy link
Contributor

archmoj commented May 20, 2020

Not sure if this should be labeled as a bug; whereas we have this logic:

if(_tickmode === 'array' &&
(axType === 'log' || axType === 'date')) {
tickmode = containerOut.tickmode = 'auto';

@nicolaskruchten
Copy link
Contributor Author

And yet we say: "(*array* is the default value if tickvals is provided)" in https://github.com/plotly/plotly.js/blob/master/src/plots/cartesian/layout_attributes.js#L378

So what is the actual value of tickmode for date axes when tickvals is provided and tickmode is not provided? Because that does display the desired behaviour :)

@archmoj
Copy link
Contributor

archmoj commented May 20, 2020

So what is the actual value of tickmode for date axes when tickvals is provided and tickmode is not provided? Because that does display the desired behaviour :)

tickmode would be set to array in that case.

@archmoj
Copy link
Contributor

archmoj commented May 20, 2020

The logic was present since v1.0:
Screenshot from 2020-05-20 13-27-57

It looks like a bug to me.

@nicolaskruchten
Copy link
Contributor Author

Weird! So if I don't set it, it gets set to array but it skips this check?

@archmoj
Copy link
Contributor

archmoj commented May 20, 2020

Weird! So if I don't set it, it gets set to array but it skips this check?

Positive. I think we could/shoud fix this for log as well.
I am close to open a PR for this.

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

Successfully merging a pull request may close this issue.

2 participants