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

Make ordered category algo skip over visible false traces #2489

Merged
merged 2 commits into from
Mar 30, 2018

Conversation

etpinard
Copy link
Contributor

fixes #2488

@etpinard
Copy link
Contributor Author

cc'ing back-from-vacation @alexcjohnson

@alexcjohnson
Copy link
Collaborator

Hmm, trying to figure out why this works I stumbled on another problem with ordered categories, the categories cease to be subplot-specific (though we do differentiate x/y):

Plotly.newPlot(gd, [
    {x: ['a', 'c', 'e', 'g']},
    {x: ['b', 'd', 'f', 'h'], xaxis: 'x2'}
], {
    xaxis: {categoryorder: 'category ascending', domain: [0, 0.4]},
    xaxis2: {categoryorder: 'category ascending', domain: [0.6, 1]},
    width: 700, height: 400
})

screen shot 2018-03-26 at 6 14 41 pm

Do you want to address that here or separately?

- 🔪 'pure' ordered_categories.js and move logic to
  category_order_defaults (no need for two files for this stuff here)
- replace d3.bisector-based search-and-replace algo by lookup object,
  which bring number categories on par with their string rep
  (e.g. 1 same as '1' - see issue #1460)
- use native array sort() to order categories instead of d3 version
@etpinard
Copy link
Contributor Author

Do you want to address that here or separately?

done in 80c13a9 along with #1460

@alexcjohnson
Copy link
Collaborator

Beautiful - squishes 2 bugs plus the new one reported here! 💃 💃 💃

@etpinard etpinard merged commit 3691c5c into master Mar 30, 2018
@etpinard etpinard deleted the fix-categoryorder-visible-false-bug branch March 30, 2018 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Category order, subplots, horizontal bar charts and invisible traces don't play well together
2 participants