@vizabi/bubblechart 5.1.0 → 5.2.0
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/build/bubblechart.js +31 -20
- package/build/bubblechart.js.map +1 -1
- package/build/stats.html +1 -1
- package/package.json +1 -1
package/build/bubblechart.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// https://github.com/vizabi/bubblechart#readme v5.
|
|
1
|
+
// https://github.com/vizabi/bubblechart#readme v5.2.0 build 1746287297708 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) :
|
|
@@ -44082,6 +44082,7 @@ void main(void) {
|
|
|
44082
44082
|
getSourcePosition: this.props.transitions?.getPosition,
|
|
44083
44083
|
getTargetPosition: this.props.transitions?.getPosition,
|
|
44084
44084
|
getTargetPixelOffset: this.props.transitions?.getPosition,
|
|
44085
|
+
getSourceDashOffset: this.props.transitions?.getPosition
|
|
44085
44086
|
}
|
|
44086
44087
|
//pickable: true,
|
|
44087
44088
|
//_dataDiff: (newData, oldData) => {
|
|
@@ -44189,6 +44190,7 @@ void main(void) {
|
|
|
44189
44190
|
const KEY = Symbol.for("key");
|
|
44190
44191
|
const TRAIL_KEY = Symbol.for("trailHeadKey");
|
|
44191
44192
|
const OPACITY_KEY = Symbol.for("opacity");
|
|
44193
|
+
const REQUIRED_KEY = Symbol.for("bubbleRequired");
|
|
44192
44194
|
|
|
44193
44195
|
const marginScaleH = (marginMin, ratio = 0) => height => marginMin + height * ratio;
|
|
44194
44196
|
const marginScaleW = (marginMin, ratio = 0) => width => marginMin + width * ratio;
|
|
@@ -44923,34 +44925,42 @@ void main(void) {
|
|
|
44923
44925
|
newTrailsData.length += trailsCount;
|
|
44924
44926
|
dataTrailChunkIndex = res.length;
|
|
44925
44927
|
res.length += trailsCount;
|
|
44926
|
-
selectedData.set(d[TRAIL_KEY], Object.assign({}, d));
|
|
44927
44928
|
trailChunkIndex1 = trailChunkIndex + 1;
|
|
44928
44929
|
}
|
|
44929
|
-
|
|
44930
|
-
|
|
44930
|
+
if (!d[REQUIRED_KEY]) {
|
|
44931
|
+
newTrailsData[trailChunkIndex++] = d;
|
|
44932
|
+
res[dataTrailChunkIndex++] = d;
|
|
44933
|
+
if (!selectedData.has(d[TRAIL_KEY])) selectedData.set(d[TRAIL_KEY], Object.assign({}, d));
|
|
44934
|
+
}
|
|
44931
44935
|
} else {
|
|
44932
44936
|
if (currentTrailKey) {
|
|
44933
44937
|
trailsZ[currentTrailKey] = d.size;//d.z
|
|
44934
44938
|
//newTrailsData[trailChunkIndex] = Object.assign({}, newTrailsData[trailChunkIndex - 1]);
|
|
44935
|
-
newTrailsData.fill(d, trailChunkIndex, newTrailsData.length);
|
|
44936
44939
|
//_newUpdateRangesLine.push({startRow: trailChunkIndex - 2, endRow: trailChunkIndex});
|
|
44937
44940
|
//newTrailsData[trailChunkIndex - 1] = d;
|
|
44938
|
-
|
|
44939
|
-
|
|
44940
|
-
|
|
44941
|
+
if(!d[REQUIRED_KEY]) {
|
|
44942
|
+
newTrailsData.fill(d, trailChunkIndex, newTrailsData.length);
|
|
44943
|
+
indexOffset = trailChunkIndex == trailChunkIndex1 ? 1 : 2;
|
|
44944
|
+
lastLineTrailData.push([newTrailsData[trailChunkIndex - indexOffset], newTrailsData[trailChunkIndex - indexOffset]]);
|
|
44945
|
+
newLastLineTrailData.push([newTrailsData[trailChunkIndex - indexOffset], d]);
|
|
44946
|
+
res.fill(Object.assign({uz: -15000}, res[dataTrailChunkIndex - 1]), dataTrailChunkIndex, res.length - 1);
|
|
44947
|
+
res[res.length - 1] = d;
|
|
44948
|
+
} else {
|
|
44949
|
+
res.fill(Object.assign({uz: -15000}, res[dataTrailChunkIndex - 1]), dataTrailChunkIndex, res.length - 1);
|
|
44950
|
+
res.length--;
|
|
44951
|
+
}
|
|
44941
44952
|
trailChunkIndex = newTrailsData.length;
|
|
44942
|
-
res.fill(Object.assign({uz: -15000}, res[dataTrailChunkIndex - 1]), dataTrailChunkIndex, res.length - 1);
|
|
44943
|
-
res[res.length - 1] = d;
|
|
44944
44953
|
currentTrailKey = null;
|
|
44945
44954
|
} else {
|
|
44946
|
-
res.push(d);
|
|
44955
|
+
if(!d[REQUIRED_KEY]) res.push(d);
|
|
44947
44956
|
}
|
|
44948
44957
|
}
|
|
44949
44958
|
return res;
|
|
44950
44959
|
|
|
44951
|
-
}, []) : this.model.dataArray.
|
|
44960
|
+
}, []) : this.model.dataArray.filter(d => {
|
|
44961
|
+
if (d[REQUIRED_KEY]) return false;
|
|
44952
44962
|
d.r = sharedComponents.LegacyUtils.areaToRadius(this.sScale(d.size || 0));
|
|
44953
|
-
return
|
|
44963
|
+
return true;
|
|
44954
44964
|
});
|
|
44955
44965
|
|
|
44956
44966
|
this.labelZScale = d3.scaleLinear([0, selectedData.size - 1],[-0.09, -0.05]);
|
|
@@ -44964,9 +44974,9 @@ void main(void) {
|
|
|
44964
44974
|
|
|
44965
44975
|
//console.log("__data", this.model.dataArray, this.__data, newData, this.__trailsData, newTrailsData);
|
|
44966
44976
|
|
|
44967
|
-
this.__newLabelData = trailsShowAndSomeSelected ? this.__selectedKeys.map(key => selectedData.get(key) || this.model.dataMap.get(key)).filter(d => d &&
|
|
44977
|
+
this.__newLabelData = trailsShowAndSomeSelected ? this.__selectedKeys.map(key => selectedData.get(key) || this.model.dataMap.get(key)).filter(d => d && !d[REQUIRED_KEY])
|
|
44968
44978
|
:
|
|
44969
|
-
this.__selectedKeys.map(key => this.model.dataMap.get(key)).filter(d => d &&
|
|
44979
|
+
this.__selectedKeys.map(key => this.model.dataMap.get(key)).filter(d => d && !d[REQUIRED_KEY]);
|
|
44970
44980
|
|
|
44971
44981
|
if (this.__selectedKeys.length > this.__newLabelData.length) {
|
|
44972
44982
|
const labelKeys = this.__newLabelData.map(d => d[TRAIL_KEY] || d[KEY]);
|
|
@@ -45050,7 +45060,8 @@ void main(void) {
|
|
|
45050
45060
|
|
|
45051
45061
|
this.__someHighlighted = highlightedFilter.any();
|
|
45052
45062
|
this.__highlightedMarkers = new Map(highlightedFilter.markers);
|
|
45053
|
-
|
|
45063
|
+
const activeObject = this.__highlightedMarkers.size == 1 ? Object.assign({}, this.model.dataMap.get(this.__highlightedMarkers.keys().next().value)) : null;
|
|
45064
|
+
this.activeObject = activeObject?.[REQUIRED_KEY] ? null : activeObject;
|
|
45054
45065
|
this.activeObjectData = this.activeObject ? [this.activeObject] : [];
|
|
45055
45066
|
this.opacityUpdateTrigger++;
|
|
45056
45067
|
this.deckBubble.setProps({layers: this.getBubbleLayers(undefined, false)});
|
|
@@ -45073,7 +45084,7 @@ void main(void) {
|
|
|
45073
45084
|
|
|
45074
45085
|
mobx.runInAction(() => {
|
|
45075
45086
|
if (!this.MDL.trail.show) {
|
|
45076
|
-
this.__labelData = this.__selectedKeys.map(key => this.model.dataMap.get(key));
|
|
45087
|
+
this.__labelData = this.__selectedKeys.map(key => this.model.dataMap.get(key)).filter(d => d && !d[REQUIRED_KEY]);
|
|
45077
45088
|
this.opacityUpdateTrigger++;
|
|
45078
45089
|
this.deckBubble.setProps({layers: this.getBubbleLayers(undefined, false)});
|
|
45079
45090
|
}
|
|
@@ -45199,10 +45210,10 @@ void main(void) {
|
|
|
45199
45210
|
//const trailShow = this.MDL.trail.show;
|
|
45200
45211
|
//const trailStarts = this.MDL.trail.starts;
|
|
45201
45212
|
//const trailGroupDim = this.MDL.trail.groupDim;
|
|
45213
|
+
const d = this.activeObject;
|
|
45202
45214
|
|
|
45203
|
-
if (highlightedFilter.markers.size === 1) {
|
|
45215
|
+
if (highlightedFilter.markers.size === 1 && d && !d[REQUIRED_KEY]) {
|
|
45204
45216
|
highlightedFilter.markers.keys().next().value;
|
|
45205
|
-
const d = this.activeObject;
|
|
45206
45217
|
//Object.assign(this.model.dataMap.get(highlightedKey));
|
|
45207
45218
|
const selectedKey = d[TRAIL_KEY] || d[KEY];
|
|
45208
45219
|
|
|
@@ -46317,7 +46328,7 @@ void main(void) {
|
|
|
46317
46328
|
}
|
|
46318
46329
|
});
|
|
46319
46330
|
|
|
46320
|
-
BubbleChart.versionInfo = { version: "5.
|
|
46331
|
+
BubbleChart.versionInfo = { version: "5.2.0", build: 1746287297708, package: {"homepage":"https://github.com/vizabi/bubblechart#readme","name":"@vizabi/bubblechart","description":"Vizabi bubble chart"}, sharedComponents: sharedComponents.versionInfo};
|
|
46321
46332
|
|
|
46322
46333
|
exports.Base = BubbleChart;
|
|
46323
46334
|
|