-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Multicategory sorting fixes #3362
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
Changes from 3 commits
d3d7b47
7e4c85a
5b490f7
583a8f3
96edd72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2524,9 +2524,9 @@ plots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts) | |
}; | ||
|
||
plots.doCalcdata = function(gd, traces) { | ||
var axList = axisIDs.list(gd), | ||
fullData = gd._fullData, | ||
fullLayout = gd._fullLayout; | ||
var axList = axisIDs.list(gd); | ||
var fullData = gd._fullData; | ||
var fullLayout = gd._fullLayout; | ||
|
||
var trace, _module, i, j; | ||
|
||
|
@@ -2579,7 +2579,7 @@ plots.doCalcdata = function(gd, traces) { | |
); | ||
} | ||
|
||
clearAxesCalc(axList); | ||
setupAxisCategories(axList, fullData); | ||
|
||
var hasCalcTransform = false; | ||
|
||
|
@@ -2617,7 +2617,7 @@ plots.doCalcdata = function(gd, traces) { | |
} | ||
|
||
// clear stuff that should recomputed in 'regular' loop | ||
if(hasCalcTransform) clearAxesCalc(axList); | ||
if(hasCalcTransform) setupAxisCategories(axList); | ||
|
||
function calci(i, isContainer) { | ||
trace = fullData[i]; | ||
|
@@ -2675,9 +2675,13 @@ plots.doCalcdata = function(gd, traces) { | |
Registry.getComponentMethod('errorbars', 'calc')(gd); | ||
}; | ||
|
||
function clearAxesCalc(axList) { | ||
function setupAxisCategories(axList, fullData) { | ||
for(var i = 0; i < axList.length; i++) { | ||
axList[i].clearCalc(); | ||
var ax = axList[i]; | ||
ax.clearCalc(); | ||
if(ax.type === 'multicategory') { | ||
ax.setupMultiCategory(fullData); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"data": [{ | ||
"x": [[1, 2, 3, 4, 5 ,6], | ||
[1, 2, 1, 2, 1 ,2]], | ||
"y": [1, 2, 3, 4, 5 ,6] | ||
}, | ||
|
||
{ | ||
"x": [[1, 2, 3, 4, 5, 6], | ||
[1, 2, 1, 2, 1, 2]], | ||
"y": [1, 2, 3, 4, 5, 6], | ||
"xaxis": "x2", | ||
"yaxis": "y2" | ||
}, | ||
{ | ||
"x": [[4, 5, 6, 7, 8, 9], | ||
[1, 2, 1, 2, 1, 2]], | ||
"y": [1, 2, 3, 4, 5, 6], | ||
"xaxis": "x2", | ||
"yaxis": "y2" | ||
}, | ||
|
||
{ | ||
"x": [[1, 2, 3, 4, 5, 6, 4, 5, 6, 7, 8, 9], | ||
[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]], | ||
"y": [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6], | ||
"xaxis": "x3", | ||
"yaxis": "y3" | ||
}], | ||
archmoj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"layout": { | ||
"grid": {"rows": 2, "columns": 2, "pattern": "independent", "xgap": 0.1, "ygap": 0.15}, | ||
"width": 700, | ||
"height": 400, | ||
"margin": {"l": 20, "b": 40, "t": 20, "r": 20}, | ||
"showlegend": false | ||
} | ||
} |
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.
, fullData
?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.
maybe a can of worms, but is there a test for multicat + calctransforms (or non-calc-transforms for that matter)?
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.
Multicategory axes don't support transforms. I'm not sure how gracefully things fail though.
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.
OK, that's fine. Nothing more from me - I'll let one of the other folks give this a once-over and the 💃
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.
Transforms + multicategory tracked in -> #3363