Skip to content

Commit d53e52c

Browse files
committed
sort categories by value: merge histogram and scatter logic
1 parent 0ba044a commit d53e52c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

Diff for: src/plots/plots.js

+6-11
Original file line numberDiff line numberDiff line change
@@ -2867,17 +2867,12 @@ function sortAxisCategoriesByValue(axList, gd) {
28672867
var cd = gd.calcdata[traceIndex];
28682868
for(k = 0; k < cd.length; k++) {
28692869
var cat, value;
2870-
if(type === 'scatter') {
2871-
if(ax._id[0] === 'x') {
2872-
cat = cd[k].x;
2873-
value = cd[k].y;
2874-
} else if(ax._id[0] === 'y') {
2875-
cat = cd[k].y;
2876-
value = cd[k].x;
2877-
}
2878-
} else if(type === 'histogram') {
2879-
cat = cd[k].p;
2880-
value = cd[k].s;
2870+
if(ax._id[0] === 'x') {
2871+
cat = cd[k].x;
2872+
value = cd[k].y;
2873+
} else if(ax._id[0] === 'y') {
2874+
cat = cd[k].y;
2875+
value = cd[k].x;
28812876
}
28822877
categoriesValue[cat][1].push(value);
28832878
}

0 commit comments

Comments
 (0)