@vizabi/bubblechart 4.1.7 → 4.1.8

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 v4.1.7 build 1732020146309 Copyright 2024 Gapminder Foundation and contributors
1
+ // https://github.com/vizabi/bubblechart#readme v4.1.8 build 1737499944940 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) :
@@ -1597,10 +1597,12 @@
1597
1597
  this._date.setText(this.MDL.frame.value, duration);
1598
1598
  }
1599
1599
 
1600
- __getColor(key, valueC) {
1601
- return valueC != null && !sharedComponents.LegacyUtils.isNaN(valueC)
1602
- ? (this.MDL.color.scale.isPattern ? `url(#flag-${key}-${this.id})` : this.cScale(valueC))
1603
- : COLOR_WHITEISH;
1600
+ __getColor(d, valueC) {
1601
+ if (valueC == null || sharedComponents.LegacyUtils.isNaN(valueC)) return COLOR_WHITEISH;
1602
+
1603
+ if (this.MDL.color.scale.isPattern) return `url(#flag-${this.MDL.color.data.createKeyFn()(d)}-${this.id})`;
1604
+
1605
+ return this.cScale(valueC);
1604
1606
  }
1605
1607
  __getColorForTrail(valueC, valueS) {
1606
1608
  if(valueC == null || sharedComponents.LegacyUtils.isNaN(valueC) || this.MDL.color.scale.isPattern) return COLOR_BLACKISH;
@@ -1684,7 +1686,7 @@
1684
1686
  d.r = sharedComponents.LegacyUtils.areaToRadius(_this.sScale(valueS || 0));
1685
1687
  const scaledX = _this.xScale(valueX);
1686
1688
  const scaledY = _this.yScale(valueY);
1687
- const scaledC = _this.__getColor(d[Symbol.for(isTrail ? "trailHeadKey" : "key")], valueC);
1689
+ const scaledC = _this.__getColor(d, valueC);
1688
1690
 
1689
1691
  if (!duration || !headTrail) {
1690
1692
  circle
@@ -1758,7 +1760,7 @@
1758
1760
  //view.classed("vzb-hidden", d.hidden);
1759
1761
  const scaledX = _this.xScale(valueX);
1760
1762
  const scaledY = _this.yScale(valueY);
1761
- const scaledC = _this.__getColor(d[Symbol.for(isTrail ? "trailHeadKey" : "key")], valueC);
1763
+ const scaledC = _this.__getColor(d, valueC);
1762
1764
 
1763
1765
  const group = d3.select(this);
1764
1766
  if (!duration || !headTrail) {
@@ -1892,7 +1894,7 @@
1892
1894
  d.r = sharedComponents.LegacyUtils.areaToRadius(_this.sScale(valueS || 0));
1893
1895
  const scaledX = _this.xScale(valueX);
1894
1896
  const scaledY = _this.yScale(valueY);
1895
- const scaledC = _this.__getColor(d[Symbol.for(isTrail ? "trailHeadKey" : "key")], valueC);
1897
+ const scaledC = _this.__getColor(d, valueC);
1896
1898
 
1897
1899
  const group = d3.select(this);
1898
1900
 
@@ -2469,7 +2471,7 @@
2469
2471
  const x = _this.xScale(d[_this._alias("x")]);
2470
2472
  const y = _this.yScale(d[_this._alias("y")]);
2471
2473
  const s = d.r;
2472
- const c = _this.__getColor(selectedKey, d.color);
2474
+ const c = _this.__getColor(d, d.color);
2473
2475
  let entityOutOfView = false;
2474
2476
 
2475
2477
  if (x + s < 0 || x - s > this.width || y + s < 0 || y - s > this.height) {
@@ -2896,7 +2898,7 @@
2896
2898
  }
2897
2899
  });
2898
2900
 
2899
- BubbleChart.versionInfo = { version: "4.1.7", build: 1732020146309, package: {"homepage":"https://github.com/vizabi/bubblechart#readme","name":"@vizabi/bubblechart","description":"Vizabi bubble chart"}, sharedComponents: sharedComponents.versionInfo};
2901
+ BubbleChart.versionInfo = { version: "4.1.8", build: 1737499944940, package: {"homepage":"https://github.com/vizabi/bubblechart#readme","name":"@vizabi/bubblechart","description":"Vizabi bubble chart"}, sharedComponents: sharedComponents.versionInfo};
2900
2902
 
2901
2903
  exports.Base = BubbleChart;
2902
2904