Sort + set 'categoryarray'#1689
Merged
Merged
Conversation
| } | ||
| }; | ||
|
|
||
| plots.initCategories = function(axList) { |
Collaborator
There was a problem hiding this comment.
is there a reason to export this fn?
Collaborator
There was a problem hiding this comment.
Not a big deal, but I'd prefer not to since it goes into Plotly.Plots
rreusser
reviewed
May 15, 2017
| // initialize the category list, if there is one, so we start over | ||
| // to be filled in later by ax.d2c | ||
| for(var i = 0; i < axList.length; i++) { | ||
| axList[i]._categories = axList[i]._initialCategories.slice(); |
Contributor
There was a problem hiding this comment.
Certainly would have been caught by now if this could ever be undefined, right? (I'm too cautious about checking for undefined unnecessarily)
Contributor
Author
There was a problem hiding this comment.
Yeah. That _initialCategories thing is set in the defaults. Calling Plots.doCalcdata before supplyDefaults is like 🔫 yourself in the 👣 .
Contributor
There was a problem hiding this comment.
Haha the squirt gun. And then your socks are wet for the rest of the day.
Collaborator
|
💃 very clean! But consider #1689 (comment) before merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
currently gives:
where the categories are re-arranged after the
sorttransform - which is consistent with how we handle categories infiltertransforms. See PR #1260 for more details.But setting
layout.xaxis.categoryarray: ['A', 'B', 'C]-- which implies that the category positions are fixed -- curently gives the same results as above.With commit 7a2a2e1
now gives:
where
categoryarrayis honored.cc @n-riesco @alexcjohnson