|
1 | 1 | var widgets = require("@jupyter-widgets/base"); |
2 | 2 | var _ = require("lodash"); |
3 | 3 |
|
4 | | -window.PlotlyConfig = {MathJaxConfig: "local"}; |
| 4 | +window.PlotlyConfig = {MathJaxConfig: "local"}; |
5 | 5 | var Plotly = require("plotly.js/dist/plotly"); |
6 | 6 | var semver_range = "^" + require("../package.json").version; |
7 | 7 |
|
@@ -919,9 +919,18 @@ var FigureView = widgets.DOMWidgetView.extend({ |
919 | 919 | pointsObject["trace_indexes"][flatPointIndex] = pointObjects[p]["curveNumber"]; |
920 | 920 | } |
921 | 921 | } |
922 | | - pointsObject["point_indexes"].sort(function(a, b) { |
923 | | - return a - b; |
924 | | - }); |
| 922 | + |
| 923 | + let single_trace = true; |
| 924 | + for (let i = 1; i < numPointNumbers; i++) { |
| 925 | + single_trace = single_trace && (pointsObject["trace_indexes"][i - 1] === pointsObject["trace_indexes"][i]) |
| 926 | + if (!single_trace) break; |
| 927 | + } |
| 928 | + if (single_trace) { |
| 929 | + pointsObject["point_indexes"].sort((function (a, b) { |
| 930 | + return a - b |
| 931 | + })) |
| 932 | + } |
| 933 | + |
925 | 934 | } else { |
926 | 935 | for (var p = 0; p < numPoints; p++) { |
927 | 936 | pointsObject["trace_indexes"][p] = pointObjects[p]["curveNumber"]; |
|
0 commit comments