@vizabi/bubblechart 5.2.3 → 5.4.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 +206 -128
- 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.4.0 build 1763740005307 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) :
|
|
@@ -44465,6 +44465,7 @@ void main(void) {
|
|
|
44465
44465
|
this.DOM.canvasWrap.select("canvas")
|
|
44466
44466
|
.call(this._panZoom.dragRectangle)
|
|
44467
44467
|
.call(this._panZoom.zoomer)
|
|
44468
|
+
.on("contextmenu", (evt) => evt.preventDefault())
|
|
44468
44469
|
.on("dblclick.zoom", null)
|
|
44469
44470
|
.on("mouseup", () => {
|
|
44470
44471
|
_this.draggingNow = false;
|
|
@@ -45730,34 +45731,35 @@ void main(void) {
|
|
|
45730
45731
|
//}, 0);
|
|
45731
45732
|
}
|
|
45732
45733
|
},
|
|
45733
|
-
onClick: ({ object:d, index }) => {
|
|
45734
|
-
//console.log("onclick", d, this.activeObject);
|
|
45734
|
+
onClick: ({ object:d, index }, event) => {
|
|
45735
45735
|
if (!d) return;
|
|
45736
|
-
//
|
|
45736
|
+
//invisible bubbles should not react to clicks
|
|
45737
45737
|
if (this._getBubbleOpacity(d) == 0) return;
|
|
45738
|
-
|
|
45739
|
-
|
|
45740
|
-
|
|
45741
|
-
|
|
45742
|
-
const
|
|
45743
|
-
|
|
45744
|
-
|
|
45738
|
+
//no reaction on trail bubbles either
|
|
45739
|
+
if (d[TRAIL_KEY]) return;
|
|
45740
|
+
|
|
45741
|
+
mobx.runInAction(() => {
|
|
45742
|
+
const dataKey = {[KEY] : d[KEY]};
|
|
45743
|
+
|
|
45744
|
+
if (event.rightButton) {
|
|
45745
|
+
dataKey.name = this.__labelWithoutFrame(d);
|
|
45746
|
+
const margin = this.profileConstants.margin;
|
|
45747
|
+
const toolNode = this.element.node();
|
|
45748
|
+
const x = (this.width - event.offsetCenter.x) < 250 ? this.width - 250 : event.offsetCenter.x - 5;
|
|
45749
|
+
|
|
45750
|
+
//set context menu
|
|
45751
|
+
const contextMenuComponent = this.root.findChild({type: "MarkerContextmenu"});
|
|
45752
|
+
contextMenuComponent.show(dataKey, {
|
|
45753
|
+
x: toolNode.offsetLeft + x + margin.left * this.profileConstants.leftMarginRatio,
|
|
45754
|
+
y: toolNode.offsetTop + event.offsetCenter.y + margin.top - 5
|
|
45755
|
+
});
|
|
45745
45756
|
} else {
|
|
45746
|
-
dataKey
|
|
45757
|
+
this.MDL.selected.data.filter.toggle(dataKey);
|
|
45747
45758
|
}
|
|
45748
|
-
}
|
|
45749
|
-
|
|
45750
|
-
|
|
45751
|
-
|
|
45752
|
-
console.log("click toggle", dataKey);
|
|
45753
|
-
});
|
|
45754
|
-
//this.activeObject = d;
|
|
45755
|
-
//if (invalidate) {
|
|
45756
|
-
//setTimeout(() => {
|
|
45757
|
-
//console.log("invalidate", d, this.activeObject);
|
|
45758
|
-
this.deckBubble.setProps({layers: this.getBubbleLayers(undefined, false, 0, false)});
|
|
45759
|
-
//}, 0);
|
|
45760
|
-
//}
|
|
45759
|
+
});
|
|
45760
|
+
|
|
45761
|
+
// not sure why this is needed? -- angie
|
|
45762
|
+
//this.deckBubble.setProps({layers: this.getBubbleLayers(undefined, false, 0, false)})
|
|
45761
45763
|
},
|
|
45762
45764
|
}
|
|
45763
45765
|
}
|
|
@@ -46133,15 +46135,14 @@ void main(void) {
|
|
|
46133
46135
|
|
|
46134
46136
|
constructor(config){
|
|
46135
46137
|
|
|
46136
|
-
const
|
|
46137
|
-
const
|
|
46138
|
-
config.Vizabi.utils.applyDefaults(fullMarker
|
|
46138
|
+
const fullMarker = config.model.markers?.bubble;
|
|
46139
|
+
const fullMarkerLegend = config.model.markers?.legend;
|
|
46140
|
+
config.Vizabi.utils.applyDefaults(fullMarker?.config, BubbleChart.DEFAULT_MODEL.bubble);
|
|
46141
|
+
config.Vizabi.utils.applyDefaults(fullMarkerLegend?.config || {}, BubbleChart.DEFAULT_MODEL.legend);
|
|
46139
46142
|
|
|
46140
46143
|
const frameType = config.Vizabi.stores.encodings.modelTypes.frame;
|
|
46141
46144
|
const { marker, splashMarker } = frameType.splashMarker(fullMarker);
|
|
46142
46145
|
|
|
46143
|
-
config.model.markers[markerName] = marker;
|
|
46144
|
-
|
|
46145
46146
|
config.name = "bubblechart";
|
|
46146
46147
|
|
|
46147
46148
|
config.subcomponents = [{
|
|
@@ -46168,6 +46169,11 @@ void main(void) {
|
|
|
46168
46169
|
placeholder: ".vzb-treemenu",
|
|
46169
46170
|
model: marker,
|
|
46170
46171
|
name: "tree-menu"
|
|
46172
|
+
},{
|
|
46173
|
+
type: sharedComponents.MarkerContextmenu,
|
|
46174
|
+
placeholder: ".vzb-marker-contextmenu",
|
|
46175
|
+
model: marker,
|
|
46176
|
+
name: "marker-contextmenu"
|
|
46171
46177
|
},{
|
|
46172
46178
|
type: sharedComponents.DataWarning,
|
|
46173
46179
|
placeholder: ".vzb-datawarning",
|
|
@@ -46188,12 +46194,6 @@ void main(void) {
|
|
|
46188
46194
|
placeholder: ".vzb-buttonlist",
|
|
46189
46195
|
model: marker,
|
|
46190
46196
|
name: "buttons"
|
|
46191
|
-
},{
|
|
46192
|
-
type: sharedComponents.SpaceConfig,
|
|
46193
|
-
placeholder: ".vzb-spaceconfig",
|
|
46194
|
-
options: {button: ".vzb-spaceconfig-button"},
|
|
46195
|
-
model: marker,
|
|
46196
|
-
name: "space-config"
|
|
46197
46197
|
},{
|
|
46198
46198
|
type: sharedComponents.ErrorMessage,
|
|
46199
46199
|
placeholder: ".vzb-errormessage",
|
|
@@ -46212,8 +46212,8 @@ void main(void) {
|
|
|
46212
46212
|
<div class="vzb-buttonlist"></div>
|
|
46213
46213
|
</div>
|
|
46214
46214
|
<div class="vzb-treemenu"></div>
|
|
46215
|
+
<div class="vzb-marker-contextmenu"></div>
|
|
46215
46216
|
<div class="vzb-datawarning"></div>
|
|
46216
|
-
<div class="vzb-spaceconfig"></div>
|
|
46217
46217
|
<div class="vzb-datanotes"></div>
|
|
46218
46218
|
<div class="vzb-errormessage"></div>
|
|
46219
46219
|
`;
|
|
@@ -46233,9 +46233,12 @@ void main(void) {
|
|
|
46233
46233
|
}
|
|
46234
46234
|
|
|
46235
46235
|
BubbleChart.DEFAULT_UI = {
|
|
46236
|
+
"locale": { "id": "en", "shortNumberFormat": true },
|
|
46237
|
+
"layout": { "projector": false },
|
|
46238
|
+
|
|
46236
46239
|
//ui
|
|
46237
46240
|
"buttons": {
|
|
46238
|
-
"buttons": ["
|
|
46241
|
+
"buttons": ["markercontrols", "colors", "trails", "moreoptions", "presentation", "sidebarcollapse", "fullscreen"]
|
|
46239
46242
|
},
|
|
46240
46243
|
"dialogs": {
|
|
46241
46244
|
"dialogs": {
|
|
@@ -46243,116 +46246,191 @@ void main(void) {
|
|
|
46243
46246
|
"sidebar": ["colors", "markercontrols", "size", "zoom"],
|
|
46244
46247
|
"moreoptions": ["opacity", "speed", "axes", "size", "colors", "label", "zoom", "technical", "repeat", "presentation", "about"]
|
|
46245
46248
|
},
|
|
46246
|
-
"markercontrols": {
|
|
46249
|
+
"markercontrols": {
|
|
46250
|
+
"disableSlice": true,
|
|
46251
|
+
"disableAddRemoveGroups": true,
|
|
46252
|
+
"primaryDim": null,
|
|
46253
|
+
"drilldown": null,
|
|
46254
|
+
"shortcutForSwitch": false,
|
|
46255
|
+
"shortcutForSwitch_allow": null
|
|
46256
|
+
}
|
|
46247
46257
|
},
|
|
46248
|
-
|
|
46249
|
-
|
|
46250
|
-
|
|
46251
|
-
|
|
46252
|
-
|
|
46253
|
-
|
|
46254
|
-
|
|
46255
|
-
|
|
46256
|
-
|
|
46257
|
-
|
|
46258
|
-
|
|
46259
|
-
|
|
46260
|
-
|
|
46261
|
-
|
|
46262
|
-
|
|
46263
|
-
|
|
46264
|
-
|
|
46265
|
-
|
|
46266
|
-
|
|
46267
|
-
|
|
46258
|
+
"marker-contextmenu": {
|
|
46259
|
+
"primaryDim": null,
|
|
46260
|
+
"drilldown": null,
|
|
46261
|
+
},
|
|
46262
|
+
"chart": {
|
|
46263
|
+
"show_ticks": true,
|
|
46264
|
+
"showForecast": false,
|
|
46265
|
+
"showForecastOverlay": true,
|
|
46266
|
+
"pauseBeforeForecast": true,
|
|
46267
|
+
"endBeforeForecast": null, //value like "2022", auto-resolved to current time minus one frame step
|
|
46268
|
+
"opacityHighlight": 1.0,
|
|
46269
|
+
"opacitySelect": 1.0,
|
|
46270
|
+
"opacityHighlightDim": 0.1,
|
|
46271
|
+
"opacitySelectDim": 0.3,
|
|
46272
|
+
"opacityRegular": 0.8,
|
|
46273
|
+
"timeInBackground": true,
|
|
46274
|
+
"timeInTrails": true,
|
|
46275
|
+
"lockNonSelected": 0,
|
|
46276
|
+
"panWithArrow": true,
|
|
46277
|
+
"adaptMinMaxZoom": false,
|
|
46278
|
+
"cursorMode": "arrow",
|
|
46279
|
+
"zoomOnScrolling": true,
|
|
46280
|
+
"superhighlightOnMinimapHover": true,
|
|
46281
|
+
"whenHovering": {
|
|
46282
|
+
"showProjectionLineX": true,
|
|
46283
|
+
"showProjectionLineY": true,
|
|
46284
|
+
"higlightValueX": true,
|
|
46285
|
+
"higlightValueY": true
|
|
46268
46286
|
},
|
|
46269
|
-
|
|
46270
|
-
|
|
46271
|
-
|
|
46272
|
-
|
|
46273
|
-
higlightValueX: true,
|
|
46274
|
-
higlightValueY: true
|
|
46287
|
+
"labels": {
|
|
46288
|
+
"enabled": true,
|
|
46289
|
+
"dragging": true,
|
|
46290
|
+
"removeLabelBox": false
|
|
46275
46291
|
},
|
|
46276
|
-
|
|
46277
|
-
|
|
46278
|
-
|
|
46279
|
-
removeLabelBox: false
|
|
46292
|
+
"margin": {
|
|
46293
|
+
"left": 0,
|
|
46294
|
+
"top": 0
|
|
46280
46295
|
},
|
|
46281
|
-
|
|
46282
|
-
|
|
46283
|
-
|
|
46296
|
+
"decorations": {
|
|
46297
|
+
"enabled": false,
|
|
46298
|
+
"xAxisGroups": null //left to be set by external page. example: {
|
|
46299
|
+
// "gdp_pcap": [
|
|
46300
|
+
// { "min": null, "max": 2650, "label": "incomegroups/level1", "label_short": "incomegroups/level1short" },
|
|
46301
|
+
// { "min": 2650, "max": 8000, "label": "incomegroups/level2", "label_short": "incomegroups/level2short" },
|
|
46302
|
+
// { "min": 8000, "max": 24200, "label": "incomegroups/level3", "label_short": "incomegroups/level3short" },
|
|
46303
|
+
// { "min": 24200, "max": null, "label": "incomegroups/level4", "label_short": "incomegroups/level4short" }
|
|
46304
|
+
// ]
|
|
46305
|
+
// }
|
|
46284
46306
|
}
|
|
46285
46307
|
},
|
|
46286
46308
|
"data-warning": {
|
|
46287
|
-
|
|
46288
|
-
|
|
46289
|
-
|
|
46290
|
-
|
|
46309
|
+
"enable": false,
|
|
46310
|
+
"margin": {
|
|
46311
|
+
"LARGE": { "bottom": 90 },
|
|
46312
|
+
"MEDIUM": { "bottom": 70 },
|
|
46313
|
+
"SMALL": { "bottom": 50 }
|
|
46291
46314
|
}
|
|
46315
|
+
},
|
|
46316
|
+
"tree-menu": {
|
|
46317
|
+
"showDataSources": false,
|
|
46318
|
+
"folderStrategyByDataset": {}
|
|
46292
46319
|
}
|
|
46293
46320
|
};
|
|
46294
46321
|
|
|
46295
46322
|
BubbleChart.mainComponent = VizabiBubbleChart;
|
|
46296
46323
|
|
|
46297
|
-
BubbleChart.
|
|
46298
|
-
|
|
46299
|
-
|
|
46300
|
-
"
|
|
46301
|
-
|
|
46302
|
-
|
|
46303
|
-
|
|
46304
|
-
|
|
46305
|
-
|
|
46324
|
+
BubbleChart.DEFAULT_MODEL = {
|
|
46325
|
+
"bubble": {
|
|
46326
|
+
"requiredEncodings": ["x", "y", "size"],
|
|
46327
|
+
"encoding": {
|
|
46328
|
+
"show": { "modelType": "selection" },
|
|
46329
|
+
"selected": {
|
|
46330
|
+
"modelType": "selection",
|
|
46331
|
+
"data": {
|
|
46332
|
+
"filter": {
|
|
46333
|
+
"ref": `markers.bubble.encoding.trail.data.filter`
|
|
46334
|
+
}
|
|
46306
46335
|
}
|
|
46336
|
+
},
|
|
46337
|
+
"highlighted": { "modelType": "selection" },
|
|
46338
|
+
"superhighlighted": { "modelType": "selection" },
|
|
46339
|
+
"x": {
|
|
46340
|
+
"data": { },
|
|
46341
|
+
"scale": {
|
|
46342
|
+
"allowedTypes": ["linear", "log", "genericLog", "pow", "time"]
|
|
46343
|
+
}
|
|
46344
|
+
},
|
|
46345
|
+
"y": {
|
|
46346
|
+
"modelType": "lane",
|
|
46347
|
+
"data": { },
|
|
46348
|
+
"scale": {
|
|
46349
|
+
"allowedTypes": ["linear", "log", "genericLog", "pow", "time", "rank"]
|
|
46350
|
+
}
|
|
46351
|
+
},
|
|
46352
|
+
"order": {
|
|
46353
|
+
"modelType": "order",
|
|
46354
|
+
"direction": "desc",
|
|
46355
|
+
"data": {
|
|
46356
|
+
"ref": `markers.bubble.encoding.size.data.config`
|
|
46357
|
+
}
|
|
46358
|
+
},
|
|
46359
|
+
"size": {
|
|
46360
|
+
"data": { },
|
|
46361
|
+
"scale": {
|
|
46362
|
+
"modelType": "size",
|
|
46363
|
+
"allowedTypes": ["linear", "point"],
|
|
46364
|
+
"range": [0, 50],
|
|
46365
|
+
"extent": [0, 1]
|
|
46366
|
+
}
|
|
46367
|
+
},
|
|
46368
|
+
"color": {
|
|
46369
|
+
"data": { "constant": "_default" },
|
|
46370
|
+
"scale": {
|
|
46371
|
+
"modelType": "color"
|
|
46372
|
+
}
|
|
46373
|
+
},
|
|
46374
|
+
"label": { "data": { "modelType": "entityPropertyDataConfig" } },
|
|
46375
|
+
"frame": { "modelType": "frame", "speed": 200, "splash": true },
|
|
46376
|
+
"trail": { "modelType": "trail", "show": false },
|
|
46377
|
+
"size_label": {
|
|
46378
|
+
"data": {
|
|
46379
|
+
"constant": "_default"
|
|
46380
|
+
},
|
|
46381
|
+
"scale": {
|
|
46382
|
+
"extent": [0, 0.22],
|
|
46383
|
+
"modelType": "size",
|
|
46384
|
+
"allowedTypes": ["linear", "point"],
|
|
46385
|
+
}
|
|
46386
|
+
},
|
|
46387
|
+
"repeat": {
|
|
46388
|
+
"modelType": "repeat",
|
|
46389
|
+
"useConnectedRowsAndColumns": true,
|
|
46390
|
+
"row": ["y"],
|
|
46391
|
+
"column": ["x"],
|
|
46392
|
+
"allowEnc": ["y", "x"]
|
|
46307
46393
|
}
|
|
46308
|
-
}
|
|
46309
|
-
|
|
46310
|
-
|
|
46311
|
-
"
|
|
46312
|
-
|
|
46313
|
-
|
|
46314
|
-
|
|
46315
|
-
},
|
|
46316
|
-
"y": {
|
|
46317
|
-
modelType: "lane",
|
|
46318
|
-
scale: {
|
|
46319
|
-
allowedTypes: ["linear", "log", "genericLog", "pow", "time", "rank"]
|
|
46320
|
-
}
|
|
46321
|
-
},
|
|
46322
|
-
"order": { modelType: "order",
|
|
46323
|
-
data: {
|
|
46324
|
-
ref: `markers.${markerName}.encoding.size.data.config`
|
|
46325
|
-
}
|
|
46326
|
-
},
|
|
46327
|
-
"size": {
|
|
46328
|
-
scale: {
|
|
46329
|
-
modelType: "size",
|
|
46330
|
-
allowedTypes: ["linear", "point"],
|
|
46331
|
-
range: [0, 50]
|
|
46394
|
+
}
|
|
46395
|
+
},
|
|
46396
|
+
"legend": {
|
|
46397
|
+
"data": {
|
|
46398
|
+
"ref": {
|
|
46399
|
+
"transform": "entityConceptSkipFilter",
|
|
46400
|
+
"path": "markers.bubble.encoding.color"
|
|
46332
46401
|
}
|
|
46333
46402
|
},
|
|
46334
|
-
"
|
|
46335
|
-
|
|
46336
|
-
|
|
46337
|
-
|
|
46338
|
-
|
|
46339
|
-
|
|
46340
|
-
|
|
46403
|
+
"encoding": {
|
|
46404
|
+
"color": {
|
|
46405
|
+
"data": {
|
|
46406
|
+
"concept": { "ref": "markers.bubble.encoding.color.data.concept" },
|
|
46407
|
+
"constant": { "ref": "markers.bubble.encoding.color.data.constant" }
|
|
46408
|
+
},
|
|
46409
|
+
"scale": {
|
|
46410
|
+
"modelType": "color",
|
|
46411
|
+
"palette": { "ref": "markers.bubble.encoding.color.scale.palette" },
|
|
46412
|
+
"domain": null,
|
|
46413
|
+
"range": null,
|
|
46414
|
+
"type": null,
|
|
46415
|
+
"zoomed": null,
|
|
46416
|
+
"zeroBaseline": false,
|
|
46417
|
+
"clamp": false,
|
|
46418
|
+
"allowedTypes": null
|
|
46419
|
+
}
|
|
46420
|
+
//"scale": { "ref": "markers.bubble.encoding.color.scale" }
|
|
46341
46421
|
},
|
|
46342
|
-
|
|
46343
|
-
|
|
46344
|
-
modelType: "
|
|
46345
|
-
|
|
46346
|
-
|
|
46347
|
-
|
|
46348
|
-
|
|
46349
|
-
modelType: "repeat",
|
|
46350
|
-
allowEnc: ["y", "x"]
|
|
46422
|
+
"name": { "data": { } },
|
|
46423
|
+
"order": {
|
|
46424
|
+
"modelType": "order",
|
|
46425
|
+
"direction": "asc",
|
|
46426
|
+
"data": { }
|
|
46427
|
+
},
|
|
46428
|
+
"map": { "data": { } }
|
|
46351
46429
|
}
|
|
46352
|
-
}
|
|
46353
|
-
}
|
|
46430
|
+
},
|
|
46431
|
+
};
|
|
46354
46432
|
|
|
46355
|
-
BubbleChart.versionInfo = { version: "5.
|
|
46433
|
+
BubbleChart.versionInfo = { version: "5.4.0", build: 1763740005307, package: {"homepage":"https://github.com/vizabi/bubblechart#readme","name":"@vizabi/bubblechart","description":"Vizabi bubble chart"}, sharedComponents: sharedComponents.versionInfo};
|
|
46356
46434
|
|
|
46357
46435
|
exports.Base = BubbleChart;
|
|
46358
46436
|
|