Skip to content

[Bug?] When yaxis.type == 'category' its ticks disappear when legend-isolating all traces #3157

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
Braintelligence opened this issue Oct 25, 2018 · 4 comments

Comments

@Braintelligence
Copy link

Here an example from the plotly docs with no specific axis type:
https://codepen.io/plotly/pen/mJYVJd

Here's the same example with axis type set to 'category':
https://codepen.io/anon/pen/mzarWR

When you filter all traces by clicking on the legend you will see that category ticks will disappear.

Current workaround is to leave an invisible trace with showlegend: false.

@alexcjohnson
Copy link
Collaborator

or include categoryarray https://codepen.io/alexcjohnson/pen/ePbdbq

I don't see us automatically keeping all these categories around when you hide all the traces, because there is in fact no data displayed, so the category axis has not seen any categories. Consider the case where two traces have different categories in them. Hide one of them and you wouldn't, in general, want to continue to include its categories in the chart - and anyway we would autorange them out of the viewport unless they were intermingled with the categories from the remaining trace.

@Braintelligence
Copy link
Author

Consider the case where two traces have different categories in them. Hide one of them and you wouldn't, in general, want to continue to include its categories in the chart

So I guess the reason for linear type axes not to leave out their ticks is because you can't introduce "new types" of ticks there by definition?

It's just kind of confusing by a UI/UX-standpoint to experience such behaviour of complete tick-disappearance only for this case. It would be more consistent to leave out ticks if all traces are invisible, regardless of type, then IMHO.

@etpinard
Copy link
Contributor

Related: #1618

@etpinard
Copy link
Contributor

Merging with: #1618

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

No branches or pull requests

3 participants