@@ -94,7 +94,7 @@ module.exports = g;
9494/* 1 */
9595/***/ (function(module, exports) {
9696
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"}}
9898
9999/***/ }),
100100/* 2 */
@@ -999,18 +999,47 @@ var FigureView = widgets.DOMWidgetView.extend({
999999 // Most cartesian plots
10001000 var pointObjects = data["points"];
10011001 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+ }
10021015 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 ),
10071020 };
10081021
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+ }
10141043 }
10151044
10161045 // Add z if present
@@ -19170,7 +19199,7 @@ module.exports = function(module) {
1917019199/***/ (function(module, exports, __webpack_require__) {
1917119200
1917219201/* WEBPACK VAR INJECTION */(function(global) {var require;var require;/**
19173- * plotly.js v1.55.1
19202+ * plotly.js v1.55.2
1917419203* Copyright 2012-2020, Plotly, Inc.
1917519204* All rights reserved.
1917619205* Licensed under the MIT license
@@ -144244,7 +144273,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
144244144273 ticksOut[i].periodX = v;
144245144274
144246144275 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)
144248144277 removedPreTick0Label = true;
144249144278 }
144250144279 }
@@ -229818,7 +229847,7 @@ function getSortFunc(opts, d2c) {
229818229847'use strict';
229819229848
229820229849// package version injected by `npm run preprocess`
229821- exports.version = '1.55.1 ';
229850+ exports.version = '1.55.2 ';
229822229851
229823229852},{}]},{},[26])(26)
229824229853});
0 commit comments