plotly.js 2.13.2 → 2.13.3

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plotly.js v2.13.2
2
+ * plotly.js v2.13.3
3
3
  * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -68,7 +68,7 @@ exports.topojson = saneTopojson;
68
68
  'use strict';
69
69
 
70
70
  // package version injected by `npm run preprocess`
71
- exports.version = '2.13.2';
71
+ exports.version = '2.13.3';
72
72
 
73
73
  },{}]},{},[16])(16)
74
74
  });
@@ -1,5 +1,5 @@
1
1
  /**
2
- * plotly.js (geo) v2.13.2
2
+ * plotly.js (geo) v2.13.3
3
3
  * Copyright 2012-2022, Plotly, Inc.
4
4
  * All rights reserved.
5
5
  * Licensed under the MIT license
@@ -50469,6 +50469,8 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
50469
50469
  }
50470
50470
 
50471
50471
  if(selectionErased) {
50472
+ gd._fullLayout._noEmitSelectedAtStart = true;
50473
+
50472
50474
  Registry.call('_guiRelayout', gd, {
50473
50475
  selections: list
50474
50476
  });
@@ -50610,10 +50612,10 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
50610
50612
  displayOutlines(convertPoly(mergedPolygons, isOpenMode), outlines, dragOptions);
50611
50613
 
50612
50614
  if(isSelectMode) {
50613
- var _res = reselect(gd);
50615
+ var _res = reselect(gd, false);
50614
50616
  var extraPoints = _res.eventData ? _res.eventData.points.slice() : [];
50615
50617
 
50616
- _res = reselect(gd, selectionTesters, searchTraces, dragOptions);
50618
+ _res = reselect(gd, false, selectionTesters, searchTraces, dragOptions);
50617
50619
  selectionTesters = _res.selectionTesters;
50618
50620
  eventData = _res.eventData;
50619
50621
 
@@ -50707,9 +50709,13 @@ function prepSelect(evt, startX, startY, dragOptions, mode) {
50707
50709
  }
50708
50710
  }
50709
50711
 
50710
- Registry.call('_guiRelayout', gd, {
50711
- selections: subSelections
50712
- });
50712
+ if(subSelections.length < allSelections.length) {
50713
+ gd._fullLayout._noEmitSelectedAtStart = true;
50714
+
50715
+ Registry.call('_guiRelayout', gd, {
50716
+ selections: subSelections
50717
+ });
50718
+ }
50713
50719
  }
50714
50720
  }
50715
50721
  } else {
@@ -51028,6 +51034,8 @@ function clearSelectionsCache(dragOptions, immediateSelect) {
51028
51034
  selections = newSelections(outlines, dragOptions);
51029
51035
  }
51030
51036
  if(selections) {
51037
+ gd._fullLayout._noEmitSelectedAtStart = true;
51038
+
51031
51039
  Registry.call('_guiRelayout', gd, {
51032
51040
  selections: selections
51033
51041
  }).then(function() {
@@ -51365,7 +51373,7 @@ function _doSelect(selectionTesters, searchTraces) {
51365
51373
  return allSelections;
51366
51374
  }
51367
51375
 
51368
- function reselect(gd, selectionTesters, searchTraces, dragOptions) {
51376
+ function reselect(gd, mayEmitSelected, selectionTesters, searchTraces, dragOptions) {
51369
51377
  var hadSearchTraces = !!searchTraces;
51370
51378
  var plotinfo, xRef, yRef;
51371
51379
  if(dragOptions) {
@@ -51488,15 +51496,15 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
51488
51496
  updateSelectedState(gd, allSearchTraces, eventData);
51489
51497
 
51490
51498
  var clickmode = fullLayout.clickmode;
51491
- var sendEvents = clickmode.indexOf('event') > -1;
51499
+ var sendEvents = clickmode.indexOf('event') > -1 && mayEmitSelected;
51492
51500
 
51493
51501
  if(
51494
51502
  !plotinfo && // get called from plot_api & plots
51495
- fullLayout._reselect
51503
+ mayEmitSelected
51496
51504
  ) {
51497
- if(sendEvents) {
51498
- var activePolygons = getLayoutPolygons(gd, true);
51505
+ var activePolygons = getLayoutPolygons(gd, true);
51499
51506
 
51507
+ if(activePolygons.length) {
51500
51508
  var xref = activePolygons[0].xref;
51501
51509
  var yref = activePolygons[0].yref;
51502
51510
  if(xref && yref) {
@@ -51509,8 +51517,12 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
51509
51517
 
51510
51518
  fillRangeItems(eventData, poly);
51511
51519
  }
51520
+ }
51512
51521
 
51513
- emitSelected(gd, eventData);
51522
+ if(gd._fullLayout._noEmitSelectedAtStart) {
51523
+ gd._fullLayout._noEmitSelectedAtStart = false;
51524
+ } else {
51525
+ if(sendEvents) emitSelected(gd, eventData);
51514
51526
  }
51515
51527
 
51516
51528
  fullLayout._reselect = false;
@@ -51532,7 +51544,7 @@ function reselect(gd, selectionTesters, searchTraces, dragOptions) {
51532
51544
  if(eventData.points.length) {
51533
51545
  emitSelected(gd, eventData);
51534
51546
  } else {
51535
- gd.emit('plotly_deselect', null);
51547
+ emitDeselect(gd);
51536
51548
  }
51537
51549
  }
51538
51550
 
@@ -90858,7 +90870,16 @@ plots.redrag = function(gd) {
90858
90870
  };
90859
90871
 
90860
90872
  plots.reselect = function(gd) {
90861
- Registry.getComponentMethod('selections', 'reselect')(gd);
90873
+ var fullLayout = gd._fullLayout;
90874
+
90875
+ var A = (gd.layout || {}).selections;
90876
+ var B = fullLayout._previousSelections;
90877
+ fullLayout._previousSelections = A;
90878
+
90879
+ var mayEmitSelected = fullLayout._reselect ||
90880
+ JSON.stringify(A) !== JSON.stringify(B);
90881
+
90882
+ Registry.getComponentMethod('selections', 'reselect')(gd, mayEmitSelected);
90862
90883
  };
90863
90884
 
90864
90885
  plots.generalUpdatePerTraceModule = function(gd, subplot, subplotCalcData, subplotLayout) {
@@ -97434,7 +97455,7 @@ function getSortFunc(opts, d2c) {
97434
97455
  'use strict';
97435
97456
 
97436
97457
  // package version injected by `npm run preprocess`
97437
- exports.version = '2.13.2';
97458
+ exports.version = '2.13.3';
97438
97459
 
97439
97460
  },{}]},{},[8])(8)
97440
97461
  });