-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix relayout axis category #510
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
Conversation
- trimmed down the logic - make sure that axis.categoryarray is filled in - use containerOut.type instead of containerIn.type (even though they are the same, we should always use the 'full' value of attributes after they get coerced)
- part one in fixing the category relayout bug - by using the fullLayout (i.e. containerOur) specs, we ensure that ordered categories algo uses smartly-defaulted attributes.
- part two in fixing the category relayout bug. - update the axis categories require a re-computation of the graphs calcdata.
For reference, the original axis category PR was in #419. |
|
||
var validCategories = layoutAttributes.categoryorder.values; | ||
var isValidArray = (Array.isArray(arrayIn) && arrayIn.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also like the brevity of a.length
rather than a.length > 0
but assume that most places want the more explicit version :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I'll change it to arrayIn.length > 0
@etpinard nice changes and very educational, most importantly I wholly missed the relayout aspect / regexp addition; wish to learn more about these in the near future. Re. spacing, I saw |
We should use
We are currently using these ugly regex clauses to determine whether a
|
Looks good to me. 💃 |
@etpinard this is also very useful! It would also worth copy/pasting it in a comment block. Just reading your comment on #66: initially, a glossary or a sentence/paragraph per main concept (trace, container, invasiveness of rerendering such as dostyle..docalc, etc.) as a straightforward braindump would be a great read for anyone new to the code base. It can be further edited etc. but an informal read-through soonish definitely beats a thorough, formal document a long time from now. Glad to help out on reading what you experienced folks write or maybe write a few easier ones. |
@mdtusz @monfera (cc @chriddyp )
Relayout calls involving axis
categoryorder
andcategoryarray
were not updating the graph properly.This PR fixes this and cleans up a few things in the axis category defaults code. I hope @monfera won't mind.