plotly.js 2.13.1 → 2.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,14 @@ To see all merged commits on the master branch that will be part of the next plo
9
9
 
10
10
  where X.Y.Z is the semver of most recent plotly.js release.
11
11
 
12
+ ## [2.13.2] -- 2022-07-21
13
+
14
+ ### Fixed
15
+ - Fix `sankey` select error (regression introduced in 2.13.0) [[#6265](https://github.com/plotly/plotly.js/pull/6265)]
16
+ - Handle missing drag layer of invisible `sankey` traces to fix select error [[#6267](https://github.com/plotly/plotly.js/pull/6267)]
17
+ - Emit selection event in shape drawing `dragmode`s when an existing selection is modified [[#6262](https://github.com/plotly/plotly.js/pull/6262)]
18
+
19
+
12
20
  ## [2.13.1] -- 2022-07-14
13
21
 
14
22
  ### Fixed
package/README.md CHANGED
@@ -55,7 +55,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
55
55
 
56
56
  ```html
57
57
  <head>
58
- <script src="https://cdn.plot.ly/plotly-2.13.1.min.js"></script>
58
+ <script src="https://cdn.plot.ly/plotly-2.13.2.min.js"></script>
59
59
  </head>
60
60
  <body>
61
61
  <div id="gd"></div>
@@ -72,7 +72,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
72
72
  Alternatively you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag.
73
73
  ```html
74
74
  <script type="module">
75
- import "https://cdn.plot.ly/plotly-2.13.1.min.js"
75
+ import "https://cdn.plot.ly/plotly-2.13.2.min.js"
76
76
  Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
77
77
  </script>
78
78
  ```
@@ -82,7 +82,7 @@ Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastl
82
82
  ### Un-minified versions are also available on CDN
83
83
  While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles.
84
84
  ```html
85
- <script src="https://cdn.plot.ly/plotly-2.13.1.js" charset="utf-8"></script>
85
+ <script src="https://cdn.plot.ly/plotly-2.13.2.js" charset="utf-8"></script>
86
86
  ```
87
87
 
88
88
  > Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.5. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.
package/dist/README.md CHANGED
@@ -46,9 +46,9 @@ The main plotly.js bundles weight in at:
46
46
  | 8.4 MB | 3.5 MB | 1 MB | 8.7 MB |
47
47
 
48
48
  #### CDN links
49
- > https://cdn.plot.ly/plotly-2.13.1.js
49
+ > https://cdn.plot.ly/plotly-2.13.2.js
50
50
 
51
- > https://cdn.plot.ly/plotly-2.13.1.min.js
51
+ > https://cdn.plot.ly/plotly-2.13.2.min.js
52
52
 
53
53
 
54
54
  #### npm packages
@@ -94,9 +94,9 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`.
94
94
  | 2.7 MB | 997.9 kB | 324.5 kB |
95
95
 
96
96
  #### CDN links
97
- > https://cdn.plot.ly/plotly-basic-2.13.1.js
97
+ > https://cdn.plot.ly/plotly-basic-2.13.2.js
98
98
 
99
- > https://cdn.plot.ly/plotly-basic-2.13.1.min.js
99
+ > https://cdn.plot.ly/plotly-basic-2.13.2.min.js
100
100
 
101
101
 
102
102
  #### npm packages
@@ -117,9 +117,9 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, `
117
117
  | 3.4 MB | 1.2 MB | 397.6 kB |
118
118
 
119
119
  #### CDN links
120
- > https://cdn.plot.ly/plotly-cartesian-2.13.1.js
120
+ > https://cdn.plot.ly/plotly-cartesian-2.13.2.js
121
121
 
122
- > https://cdn.plot.ly/plotly-cartesian-2.13.1.min.js
122
+ > https://cdn.plot.ly/plotly-cartesian-2.13.2.min.js
123
123
 
124
124
 
125
125
  #### npm packages
@@ -140,9 +140,9 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca
140
140
  | 3.1 MB | 1.1 MB | 367.2 kB |
141
141
 
142
142
  #### CDN links
143
- > https://cdn.plot.ly/plotly-geo-2.13.1.js
143
+ > https://cdn.plot.ly/plotly-geo-2.13.2.js
144
144
 
145
- > https://cdn.plot.ly/plotly-geo-2.13.1.min.js
145
+ > https://cdn.plot.ly/plotly-geo-2.13.2.min.js
146
146
 
147
147
 
148
148
  #### npm packages
@@ -160,12 +160,12 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`,
160
160
 
161
161
  | Raw size | Minified size | Minified + gzip size |
162
162
  |------|-----------------|------------------------|
163
- | 3.9 MB | 1.5 MB | 488.2 kB |
163
+ | 3.9 MB | 1.5 MB | 488.3 kB |
164
164
 
165
165
  #### CDN links
166
- > https://cdn.plot.ly/plotly-gl3d-2.13.1.js
166
+ > https://cdn.plot.ly/plotly-gl3d-2.13.2.js
167
167
 
168
- > https://cdn.plot.ly/plotly-gl3d-2.13.1.min.js
168
+ > https://cdn.plot.ly/plotly-gl3d-2.13.2.min.js
169
169
 
170
170
 
171
171
  #### npm packages
@@ -186,9 +186,9 @@ The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `poin
186
186
  | 4.4 MB | 1.8 MB | 580.5 kB |
187
187
 
188
188
  #### CDN links
189
- > https://cdn.plot.ly/plotly-gl2d-2.13.1.js
189
+ > https://cdn.plot.ly/plotly-gl2d-2.13.2.js
190
190
 
191
- > https://cdn.plot.ly/plotly-gl2d-2.13.1.min.js
191
+ > https://cdn.plot.ly/plotly-gl2d-2.13.2.min.js
192
192
 
193
193
 
194
194
  #### npm packages
@@ -209,9 +209,9 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym
209
209
  | 4.4 MB | 1.7 MB | 521.4 kB |
210
210
 
211
211
  #### CDN links
212
- > https://cdn.plot.ly/plotly-mapbox-2.13.1.js
212
+ > https://cdn.plot.ly/plotly-mapbox-2.13.2.js
213
213
 
214
- > https://cdn.plot.ly/plotly-mapbox-2.13.1.min.js
214
+ > https://cdn.plot.ly/plotly-mapbox-2.13.2.min.js
215
215
 
216
216
 
217
217
  #### npm packages
@@ -232,9 +232,9 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne
232
232
  | 3 MB | 1.1 MB | 357.2 kB |
233
233
 
234
234
  #### CDN links
235
- > https://cdn.plot.ly/plotly-finance-2.13.1.js
235
+ > https://cdn.plot.ly/plotly-finance-2.13.2.js
236
236
 
237
- > https://cdn.plot.ly/plotly-finance-2.13.1.min.js
237
+ > https://cdn.plot.ly/plotly-finance-2.13.2.min.js
238
238
 
239
239
 
240
240
  #### npm packages
@@ -252,12 +252,12 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca
252
252
 
253
253
  | Raw size | Minified size | Minified + gzip size |
254
254
  |------|-----------------|------------------------|
255
- | 8.8 MB | 3.8 MB | 1.1 MB |
255
+ | 8.8 MB | 3.9 MB | 1.1 MB |
256
256
 
257
257
  #### CDN links
258
- > https://cdn.plot.ly/plotly-strict-2.13.1.js
258
+ > https://cdn.plot.ly/plotly-strict-2.13.2.js
259
259
 
260
- > https://cdn.plot.ly/plotly-strict-2.13.1.min.js
260
+ > https://cdn.plot.ly/plotly-strict-2.13.2.min.js
261
261
 
262
262
 
263
263
  #### npm packages
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plotly.js (basic) v2.13.1
2
+ * plotly.js (basic) v2.13.2
3
3
  * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -36592,7 +36592,14 @@ var p2r = helpers.p2r;
36592
36592
  var axValue = helpers.axValue;
36593
36593
  var getTransform = helpers.getTransform;
36594
36594
 
36595
+ function hasSubplot(dragOptions) {
36596
+ // N.B. subplot may be falsy e.g zero sankey index!
36597
+ return dragOptions.subplot !== undefined;
36598
+ }
36599
+
36595
36600
  function prepSelect(evt, startX, startY, dragOptions, mode) {
36601
+ var isCartesian = !hasSubplot(dragOptions);
36602
+
36596
36603
  var isFreeMode = freeMode(mode);
36597
36604
  var isRectMode = rectMode(mode);
36598
36605
  var isOpenMode = openMode(mode);
@@ -36606,7 +36613,7 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
36606
36613
  var gd = dragOptions.gd;
36607
36614
  var fullLayout = gd._fullLayout;
36608
36615
  var immediateSelect = isSelectMode && fullLayout.newselection.mode === 'immediate' &&
36609
- !dragOptions.subplot; // N.B. only cartesian subplots have persistent selection
36616
+ isCartesian; // N.B. only cartesian subplots have persistent selection
36610
36617
 
36611
36618
  var zoomLayer = fullLayout._zoomlayer;
36612
36619
  var dragBBox = dragOptions.element.getBoundingClientRect();
@@ -36654,9 +36661,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
36654
36661
  opacity: isDrawMode ? newStyle.opacity / 2 : 1,
36655
36662
  fill: (isDrawMode && !isOpenMode) ? newStyle.fillcolor : 'none',
36656
36663
  stroke: newStyle.line.color || (
36657
- dragOptions.subplot !== undefined ?
36658
- '#7f7f7f' : // non-cartesian subplot
36659
- Color.contrast(gd._fullLayout.plot_bgcolor) // cartesian subplot
36664
+ isCartesian ?
36665
+ Color.contrast(gd._fullLayout.plot_bgcolor) :
36666
+ '#7f7f7f' // non-cartesian subplot
36660
36667
  ),
36661
36668
  'stroke-dasharray': dashStyle(newStyle.line.dash, newStyle.line.width),
36662
36669
  'stroke-width': newStyle.line.width + 'px',
@@ -36687,6 +36694,8 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
36687
36694
 
36688
36695
  if(immediateSelect && !evt.shiftKey) {
36689
36696
  dragOptions._clearSubplotSelections = function() {
36697
+ if(!isCartesian) return;
36698
+
36690
36699
  var xRef = xAxis._id;
36691
36700
  var yRef = yAxis._id;
36692
36701
  deselectSubplot(gd, xRef, yRef, searchTraces);
@@ -36993,7 +37002,9 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
36993
37002
  dragOptions.doneFnCompleted(selection);
36994
37003
  }
36995
37004
 
36996
- emitSelected(gd, eventData);
37005
+ if(isSelectMode) {
37006
+ emitSelected(gd, eventData);
37007
+ }
36997
37008
  }).catch(Lib.error);
36998
37009
  };
36999
37010
  }
@@ -37215,15 +37226,23 @@ function coerceSelectionsCache(evt, gd, dragOptions) {
37215
37226
  }
37216
37227
  }
37217
37228
 
37229
+ function hasActiveShape(gd) {
37230
+ return gd._fullLayout._activeShapeIndex >= 0;
37231
+ }
37232
+
37233
+ function hasActiveSelection(gd) {
37234
+ return gd._fullLayout._activeSelectionIndex >= 0;
37235
+ }
37236
+
37218
37237
  function clearSelectionsCache(dragOptions, immediateSelect) {
37219
37238
  var dragmode = dragOptions.dragmode;
37220
37239
  var plotinfo = dragOptions.plotinfo;
37221
37240
 
37222
37241
  var gd = dragOptions.gd;
37223
- if(gd._fullLayout._activeShapeIndex >= 0) {
37242
+ if(hasActiveShape(gd)) {
37224
37243
  gd._fullLayout._deactivateShape(gd);
37225
37244
  }
37226
- if(gd._fullLayout._activeSelectionIndex >= 0) {
37245
+ if(hasActiveSelection(gd)) {
37227
37246
  gd._fullLayout._deactivateSelection(gd);
37228
37247
  }
37229
37248
 
@@ -37251,7 +37270,7 @@ function clearSelectionsCache(dragOptions, immediateSelect) {
37251
37270
  var selections;
37252
37271
  if(
37253
37272
  isSelectMode &&
37254
- !dragOptions.subplot // only allow cartesian - no mapbox for now
37273
+ !hasSubplot(dragOptions) // only allow cartesian - no mapbox for now
37255
37274
  ) {
37256
37275
  selections = newSelections(outlines, dragOptions);
37257
37276
  }
@@ -37290,7 +37309,10 @@ function determineSearchTraces(gd, xAxes, yAxes, subplot) {
37290
37309
 
37291
37310
  if(trace.visible !== true || !trace._module || !trace._module.selectPoints) continue;
37292
37311
 
37293
- if(subplot && (trace.subplot === subplot || trace.geo === subplot)) {
37312
+ if(
37313
+ hasSubplot({subplot: subplot}) &&
37314
+ (trace.subplot === subplot || trace.geo === subplot)
37315
+ ) {
37294
37316
  searchTraces.push(createSearchInfo(trace._module, cd, xAxes[0], yAxes[0]));
37295
37317
  } else if(trace.type === 'splom') {
37296
37318
  // FIXME: make sure we don't have more than single axis for splom
@@ -38045,13 +38067,10 @@ function getFillRangeItems(dragOptions) {
38045
38067
  }
38046
38068
 
38047
38069
  function emitSelecting(gd, eventData) {
38048
- if(drawMode(gd._fullLayout.dragmode)) return;
38049
38070
  gd.emit('plotly_selecting', eventData);
38050
38071
  }
38051
38072
 
38052
38073
  function emitSelected(gd, eventData) {
38053
- if(drawMode(gd._fullLayout.dragmode)) return;
38054
-
38055
38074
  if(eventData) {
38056
38075
  eventData.selections = (gd.layout || {}).selections || [];
38057
38076
  }
@@ -38060,7 +38079,6 @@ function emitSelected(gd, eventData) {
38060
38079
  }
38061
38080
 
38062
38081
  function emitDeselect(gd) {
38063
- if(drawMode(gd._fullLayout.dragmode)) return;
38064
38082
  gd.emit('plotly_deselect', null);
38065
38083
  }
38066
38084
 
@@ -84670,7 +84688,7 @@ function getSortFunc(opts, d2c) {
84670
84688
  'use strict';
84671
84689
 
84672
84690
  // package version injected by `npm run preprocess`
84673
- exports.version = '2.13.1';
84691
+ exports.version = '2.13.2';
84674
84692
 
84675
84693
  },{}]},{},[8])(8)
84676
84694
  });