@@ -94,7 +94,7 @@ module.exports = g;
94
94
/* 1 */
95
95
/***/ (function(module, exports) {
96
96
97
- module.exports = {"name":"plotlywidget","version":"4.9.0","description":"The plotly JupyterLab extension","author":"The plotly.py team","license":"MIT","main":"src/index.js","repository":{"type":"git","url":"https://github.com/plotly/plotly.py"},"keywords":["jupyter","widgets","ipython","ipywidgets","plotly"],"files":["src/**/*.js","dist/*.js","style/*.*"],"scripts":{"build":"webpack","clean":"rimraf dist/ && rimraf ../../python/plotly/plotlywidget/static'","test":"echo \"Error: no test specified\" && exit 1"},"devDependencies":{"webpack":"^3.10.0","rimraf":"^2.6.1","ify-loader":"^1.1.0","typescript":"~3.1.1"},"dependencies":{"plotly.js":"^1.55.1 ","@jupyter-widgets/base":"^2.0.0 || ^3.0.0","lodash":"^4.17.4"},"jupyterlab":{"extension":"src/jupyterlab-plugin.js"}}
97
+ module.exports = {"name":"plotlywidget","version":"4.9.0","description":"The plotly JupyterLab extension","author":"The plotly.py team","license":"MIT","main":"src/index.js","repository":{"type":"git","url":"https://github.com/plotly/plotly.py"},"keywords":["jupyter","widgets","ipython","ipywidgets","plotly"],"files":["src/**/*.js","dist/*.js","style/*.*"],"scripts":{"build":"webpack","clean":"rimraf dist/ && rimraf ../../python/plotly/plotlywidget/static'","test":"echo \"Error: no test specified\" && exit 1"},"devDependencies":{"webpack":"^3.10.0","rimraf":"^2.6.1","ify-loader":"^1.1.0","typescript":"~3.1.1"},"dependencies":{"plotly.js":"^1.55.2 ","@jupyter-widgets/base":"^2.0.0 || ^3.0.0","lodash":"^4.17.4"},"jupyterlab":{"extension":"src/jupyterlab-plugin.js"}}
98
98
99
99
/***/ }),
100
100
/* 2 */
@@ -999,18 +999,47 @@ var FigureView = widgets.DOMWidgetView.extend({
999
999
// Most cartesian plots
1000
1000
var pointObjects = data["points"];
1001
1001
var numPoints = pointObjects.length;
1002
+
1003
+ var hasNestedPointObjects = true;
1004
+ for (let i = 0; i < numPoints; i++) {
1005
+ hasNestedPointObjects = (hasNestedPointObjects && pointObjects[i].hasOwnProperty("pointNumbers"));
1006
+ if (!hasNestedPointObjects) break;
1007
+ }
1008
+ var numPointNumbers = numPoints;
1009
+ if (hasNestedPointObjects) {
1010
+ numPointNumbers = 0;
1011
+ for (let i = 0; i < numPoints; i++) {
1012
+ numPointNumbers += pointObjects[i]["pointNumbers"].length;
1013
+ }
1014
+ }
1002
1015
pointsObject = {
1003
- trace_indexes: new Array(numPoints ),
1004
- point_indexes: new Array(numPoints ),
1005
- xs: new Array(numPoints ),
1006
- ys: new Array(numPoints ),
1016
+ trace_indexes: new Array(numPointNumbers ),
1017
+ point_indexes: new Array(numPointNumbers ),
1018
+ xs: new Array(numPointNumbers ),
1019
+ ys: new Array(numPointNumbers ),
1007
1020
};
1008
1021
1009
- for (var p = 0; p < numPoints; p++) {
1010
- pointsObject["trace_indexes"][p] = pointObjects[p]["curveNumber"];
1011
- pointsObject["point_indexes"][p] = pointObjects[p]["pointNumber"];
1012
- pointsObject["xs"][p] = pointObjects[p]["x"];
1013
- pointsObject["ys"][p] = pointObjects[p]["y"];
1022
+ if (hasNestedPointObjects) {
1023
+ var flatPointIndex = 0;
1024
+ for (var p = 0; p < numPoints; p++) {
1025
+ for (let i = 0; i < pointObjects[p]["pointNumbers"].length; i++, flatPointIndex++) {
1026
+ pointsObject["point_indexes"][flatPointIndex] = pointObjects[p]["pointNumbers"][i]
1027
+ // also add xs, ys and traces so that the array doesn't get truncated later
1028
+ pointsObject["xs"][flatPointIndex] = pointObjects[p]["x"];
1029
+ pointsObject["ys"][flatPointIndex] = pointObjects[p]["y"];
1030
+ pointsObject["trace_indexes"][flatPointIndex] = pointObjects[p]["curveNumber"];
1031
+ }
1032
+ }
1033
+ pointsObject["point_indexes"].sort(function(a, b) {
1034
+ return a - b;
1035
+ });
1036
+ } else {
1037
+ for (var p = 0; p < numPoints; p++) {
1038
+ pointsObject["trace_indexes"][p] = pointObjects[p]["curveNumber"];
1039
+ pointsObject["point_indexes"][p] = pointObjects[p]["pointNumber"];
1040
+ pointsObject["xs"][p] = pointObjects[p]["x"];
1041
+ pointsObject["ys"][p] = pointObjects[p]["y"];
1042
+ }
1014
1043
}
1015
1044
1016
1045
// Add z if present
@@ -19170,7 +19199,7 @@ module.exports = function(module) {
19170
19199
/***/ (function(module, exports, __webpack_require__) {
19171
19200
19172
19201
/* WEBPACK VAR INJECTION */(function(global) {var require;var require;/**
19173
- * plotly.js v1.55.1
19202
+ * plotly.js v1.55.2
19174
19203
* Copyright 2012-2020, Plotly, Inc.
19175
19204
* All rights reserved.
19176
19205
* Licensed under the MIT license
@@ -144244,7 +144273,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
144244
144273
ticksOut[i].periodX = v;
144245
144274
144246
144275
if(v > maxRange || v < minRange) { // hide label if outside the range
144247
- ticksOut[i].text = '';
144276
+ ticksOut[i].text = ' '; // don't use an empty string here which can confuse automargin (issue 5132)
144248
144277
removedPreTick0Label = true;
144249
144278
}
144250
144279
}
@@ -229818,7 +229847,7 @@ function getSortFunc(opts, d2c) {
229818
229847
'use strict';
229819
229848
229820
229849
// package version injected by `npm run preprocess`
229821
- exports.version = '1.55.1 ';
229850
+ exports.version = '1.55.2 ';
229822
229851
229823
229852
},{}]},{},[26])(26)
229824
229853
});
0 commit comments