@vizabi/bubblechart 5.2.1 → 5.2.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,4 +1,4 @@
1
- // https://github.com/vizabi/bubblechart#readme v5.2.1 build 1746462563188 Copyright 2025 Gapminder Foundation and contributors
1
+ // https://github.com/vizabi/bubblechart#readme v5.2.3 build 1748252204619 Copyright 2025 Gapminder Foundation and contributors
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@vizabi/shared-components'), require('d3'), require('mobx')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', '@vizabi/shared-components', 'd3', 'mobx'], factory) :
@@ -39,7 +39,7 @@
39
39
 
40
40
  this.zoomer
41
41
  .filter(this.zoomFilter())
42
- .scaleExtent([0.0625, +Infinity])
42
+ .scaleExtent([1, 100])
43
43
  .on("start", this.zoom().start)
44
44
  .on("zoom", this.zoom().go)
45
45
  .on("end", this.zoom().stop);
@@ -44454,6 +44454,14 @@ void main(void) {
44454
44454
  this.props = this.getProps();
44455
44455
 
44456
44456
  this._panZoom.zoomSelection(this.DOM.canvasWrap.select("canvas"));
44457
+ this.DOM.canvasWrap.select("canvas").node()
44458
+ .addEventListener("wheel", e => {
44459
+ if(!_this.ui?.zoomOnScrolling) return;
44460
+ e.preventDefault();
44461
+ e.stopPropagation();
44462
+ },
44463
+ { passive: false }
44464
+ );
44457
44465
  this.DOM.canvasWrap.select("canvas")
44458
44466
  .call(this._panZoom.dragRectangle)
44459
44467
  .call(this._panZoom.zoomer)
@@ -44905,6 +44913,7 @@ void main(void) {
44905
44913
  let trailChunkIndex = 0;
44906
44914
  let trailChunkIndex1 = 0;
44907
44915
  let indexOffset;
44916
+ let newData = [];
44908
44917
  //let deltaTrailChunkIndex = 0;
44909
44918
  let currentTrailKey = null;
44910
44919
  //const _updateRanges = [];
@@ -44917,7 +44926,7 @@ void main(void) {
44917
44926
  let dataTrailChunkIndex;
44918
44927
  const trailsShowAndSomeSelected = this.MDL.trail.show && this.__someSelected;
44919
44928
 
44920
- const newData = trailsShowAndSomeSelected ? this.model.dataArray.reduce((res, d, i) => {
44929
+ if (trailsShowAndSomeSelected) newData = this.model.dataArray.reduce((res, d, i) => {
44921
44930
  d.r = sharedComponents.LegacyUtils.areaToRadius(this.sScale(d.size || 0));
44922
44931
  if (d[TRAIL_KEY]) {
44923
44932
  if (!currentTrailKey) {
@@ -44957,7 +44966,18 @@ void main(void) {
44957
44966
  }
44958
44967
  return res;
44959
44968
 
44960
- }, []) : this.model.dataArray.filter(d => {
44969
+ }, []);
44970
+
44971
+ //handle a situation when user is using opacity feature to hide unselected bubbles completely
44972
+ //the invisible bubbles should be completely transparent to mouse events, better yet not exist at all
44973
+ //it is convenient to do here because we are running O(N) filter for other purposes anyway
44974
+ else if (this.__someSelected && this.ui.opacitySelectDim === 0) newData = this.model.dataArray.filter(d => {
44975
+ if (d[REQUIRED_KEY] || !this.MDL.selected.data.filter.markers.has(d[KEY])) return false;
44976
+ d.r = sharedComponents.LegacyUtils.areaToRadius(this.sScale(d.size || 0));
44977
+ return true;
44978
+ });
44979
+
44980
+ else newData = this.model.dataArray.filter(d => {
44961
44981
  if (d[REQUIRED_KEY]) return false;
44962
44982
  d.r = sharedComponents.LegacyUtils.areaToRadius(this.sScale(d.size || 0));
44963
44983
  return true;
@@ -46332,7 +46352,7 @@ void main(void) {
46332
46352
  }
46333
46353
  });
46334
46354
 
46335
- BubbleChart.versionInfo = { version: "5.2.1", build: 1746462563188, package: {"homepage":"https://github.com/vizabi/bubblechart#readme","name":"@vizabi/bubblechart","description":"Vizabi bubble chart"}, sharedComponents: sharedComponents.versionInfo};
46355
+ BubbleChart.versionInfo = { version: "5.2.3", build: 1748252204619, package: {"homepage":"https://github.com/vizabi/bubblechart#readme","name":"@vizabi/bubblechart","description":"Vizabi bubble chart"}, sharedComponents: sharedComponents.versionInfo};
46336
46356
 
46337
46357
  exports.Base = BubbleChart;
46338
46358