Skip to content

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

Closed

Description

@nicolaskruchten

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!

Activity

  1. added
    bug
    on May 20, 2020
  2. archmoj commented on May 20, 2020

    @archmoj
    Contributor

    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';

  3. nicolaskruchten commented on May 20, 2020

    @nicolaskruchten
    ContributorAuthor

    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 :)

  4. archmoj commented on May 20, 2020

    @archmoj
    Contributor

    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.

  5. archmoj commented on May 20, 2020

    @archmoj
    Contributor

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

    It looks like a bug to me.

  6. nicolaskruchten commented on May 20, 2020

    @nicolaskruchten
    ContributorAuthor

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

  7. archmoj commented on May 20, 2020

    @archmoj
    Contributor

    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.

  8. self-assigned this
    on May 20, 2020
  9. added this to the v1.54.2 milestone on May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions