@vizabi/bubblechart 3.12.2 → 3.14.1
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.css +3 -8
- package/build/bubblechart.js +133 -71
- package/build/bubblechart.js.map +1 -1
- package/build/stats.html +1 -1
- package/package.json +1 -1
package/build/bubblechart.css
CHANGED
|
@@ -171,22 +171,20 @@
|
|
|
171
171
|
.vzb-tool .vzb-bubblechart .vzb-bubblechart-svg .vzb-bc-axis-y-subtitle .tick-minor,
|
|
172
172
|
.vzb-tool .vzb-bubblechart .vzb-bubblechart-svg .vzb-bc-axis-x .tick-minor,
|
|
173
173
|
.vzb-tool .vzb-bubblechart .vzb-bubblechart-svg .vzb-bc-axis-y .tick-minor {
|
|
174
|
-
stroke
|
|
174
|
+
stroke: #d6d6d6;
|
|
175
175
|
}
|
|
176
176
|
.vzb-tool.vzb-medium .vzb-bubblechart-svg .vzb-bc-axis-x .tick line,
|
|
177
177
|
.vzb-tool.vzb-medium .vzb-bubblechart-svg .vzb-bc-axis-y .tick line,
|
|
178
178
|
.vzb-tool.vzb-medium .vzb-bubblechart-svg .vzb-bc-axis-x .tick-minor,
|
|
179
179
|
.vzb-tool.vzb-medium .vzb-bubblechart-svg .vzb-bc-axis-y .tick-minor {
|
|
180
|
-
stroke: #
|
|
181
|
-
stroke-dasharray: 1 6;
|
|
180
|
+
stroke: #d6d6d6;
|
|
182
181
|
}
|
|
183
182
|
|
|
184
183
|
.vzb-tool.vzb-large .vzb-bubblechart-svg .vzb-bc-axis-x .tick line,
|
|
185
184
|
.vzb-tool.vzb-large .vzb-bubblechart-svg .vzb-bc-axis-y .tick line,
|
|
186
185
|
.vzb-tool.vzb-large .vzb-bubblechart-svg .vzb-bc-axis-x .tick-minor,
|
|
187
186
|
.vzb-tool.vzb-large .vzb-bubblechart-svg .vzb-bc-axis-y .tick-minor {
|
|
188
|
-
stroke: #
|
|
189
|
-
stroke-dasharray: none;
|
|
187
|
+
stroke: #d6d6d6;
|
|
190
188
|
}
|
|
191
189
|
|
|
192
190
|
.vzb-tool.vzb-presentation .vzb-bubblechart-svg .vzb-bc-axis-x .tick line,
|
|
@@ -194,7 +192,6 @@
|
|
|
194
192
|
.vzb-tool.vzb-presentation .vzb-bubblechart-svg .vzb-bc-axis-x .tick-minor,
|
|
195
193
|
.vzb-tool.vzb-presentation .vzb-bubblechart-svg .vzb-bc-axis-y .tick-minor {
|
|
196
194
|
stroke: none;
|
|
197
|
-
stroke-dasharray: none;
|
|
198
195
|
}
|
|
199
196
|
|
|
200
197
|
.vzb-tool .vzb-bubblechart .vzb-bubblechart-svg .vzb-bc-axis-x-info,
|
|
@@ -512,8 +509,6 @@
|
|
|
512
509
|
stroke-width: 1px;
|
|
513
510
|
}
|
|
514
511
|
.vzb-tool .vzb-bubblechart .vzb-bubblechart-svg .vzb-bc-date {
|
|
515
|
-
filter: alpha(opacity=30);
|
|
516
|
-
opacity: 0.3;
|
|
517
512
|
font-size: 15em;
|
|
518
513
|
fill: #999;
|
|
519
514
|
text-anchor: middle;
|
package/build/bubblechart.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// https://github.com/vizabi/bubblechart#readme v3.
|
|
1
|
+
// https://github.com/vizabi/bubblechart#readme v3.14.1 build 1645171739593 Copyright 2022 Gapminder Foundation and contributors
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('VizabiSharedComponents'), require('mobx')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['VizabiSharedComponents', 'mobx'], factory) :
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
// this.dragLock = false;
|
|
17
17
|
|
|
18
18
|
this.dragRectangle
|
|
19
|
+
.filter(event => !event.button)
|
|
19
20
|
.subject(this.dragSubject())
|
|
20
21
|
.on("start", this.drag().start)
|
|
21
22
|
.on("drag", this.drag().go)
|
|
@@ -54,8 +55,8 @@
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
return {
|
|
57
|
-
x: d3.pointer(event)[0],
|
|
58
|
-
y: d3.pointer(event)[1]
|
|
58
|
+
x: d3.pointer(event, this)[0],
|
|
59
|
+
y: d3.pointer(event, this)[1]
|
|
59
60
|
};
|
|
60
61
|
};
|
|
61
62
|
}
|
|
@@ -80,8 +81,8 @@
|
|
|
80
81
|
|
|
81
82
|
// self.dragLock = true;
|
|
82
83
|
this.origin = {
|
|
83
|
-
x: d3.pointer(event)[0],
|
|
84
|
-
y: d3.pointer(event)[1]
|
|
84
|
+
x: d3.pointer(event, this)[0],
|
|
85
|
+
y: d3.pointer(event, this)[1]
|
|
85
86
|
};
|
|
86
87
|
_this.DOM.zoomRect.classed("vzb-invisible", false);
|
|
87
88
|
},
|
|
@@ -110,8 +111,8 @@
|
|
|
110
111
|
.classed("vzb-invisible", true);
|
|
111
112
|
|
|
112
113
|
this.target = {
|
|
113
|
-
x: d3.pointer(event)[0],
|
|
114
|
-
y: d3.pointer(event)[1]
|
|
114
|
+
x: d3.pointer(event, this)[0],
|
|
115
|
+
y: d3.pointer(event, this)[1]
|
|
115
116
|
};
|
|
116
117
|
if (Math.abs(this.origin.x - this.target.x) < 10 || Math.abs(this.origin.y - this.target.y) < 10) return;
|
|
117
118
|
|
|
@@ -647,7 +648,7 @@
|
|
|
647
648
|
let ratio = transform.k;
|
|
648
649
|
const pan = [transform.x, transform.y];
|
|
649
650
|
|
|
650
|
-
const mouse = d3.pointer(event);
|
|
651
|
+
const mouse = d3.pointer(event, this.zoomSelection.node());
|
|
651
652
|
let k = Math.log(ratio) / Math.LN2;
|
|
652
653
|
|
|
653
654
|
//change factor direction based on the input. default is no direction supplied
|
|
@@ -965,7 +966,7 @@
|
|
|
965
966
|
<rect class="vzb-bc-eventarea"></rect>
|
|
966
967
|
<g class="vzb-bc-trails"></g>
|
|
967
968
|
<g class="vzb-bc-bubbles"></g>
|
|
968
|
-
<rect class="vzb-bc-forecastoverlay vzb-hidden" x="0" y="0" width="100%" height="100%" fill="url(#vzb-bc-pattern-lines)" pointer-events='none'></rect>
|
|
969
|
+
<rect class="vzb-bc-forecastoverlay vzb-hidden" x="0" y="0" width="100%" height="100%" fill="url(#vzb-bc-pattern-lines-${config.id})" pointer-events='none'></rect>
|
|
969
970
|
</svg>
|
|
970
971
|
|
|
971
972
|
<g class="vzb-bc-axis-y-subtitle"><text></text></g>
|
|
@@ -997,10 +998,10 @@
|
|
|
997
998
|
</svg>
|
|
998
999
|
<svg width="0" height="0">
|
|
999
1000
|
<defs>
|
|
1000
|
-
<filter id="vzb-glow-filter" x="-50%" y="-50%" width="200%" height="200%">
|
|
1001
|
+
<filter id="vzb-glow-filter-${config.id}" x="-50%" y="-50%" width="200%" height="200%">
|
|
1001
1002
|
<feGaussianBlur in="SourceGraphic" stdDeviation="2"></feGaussianBlur>
|
|
1002
1003
|
</filter>
|
|
1003
|
-
<pattern id="vzb-bc-pattern-lines" x="0" y="0" patternUnits="userSpaceOnUse" width="50" height="50" viewBox="0 0 10 10">
|
|
1004
|
+
<pattern id="vzb-bc-pattern-lines-${config.id}" x="0" y="0" patternUnits="userSpaceOnUse" width="50" height="50" viewBox="0 0 10 10">
|
|
1004
1005
|
<path d='M-1,1 l2,-2M0,10 l10,-10M9,11 l2,-2' stroke='black' stroke-width='3' opacity='0.08'/>
|
|
1005
1006
|
</pattern>
|
|
1006
1007
|
</defs>
|
|
@@ -1025,7 +1026,8 @@
|
|
|
1025
1026
|
zoomRect: this.element.select(".vzb-bc-zoom-rect"),
|
|
1026
1027
|
eventArea: this.element.select(".vzb-bc-eventarea"),
|
|
1027
1028
|
forecastOverlay: this.element.select(".vzb-bc-forecastoverlay"),
|
|
1028
|
-
tooltipMobile: this.element.select(".vzb-tooltip-mobile")
|
|
1029
|
+
tooltipMobile: this.element.select(".vzb-tooltip-mobile"),
|
|
1030
|
+
defs: this.element.select("defs")
|
|
1029
1031
|
};
|
|
1030
1032
|
this.DOM.chartSvg.select(".vzb-bc-graph").call(graph =>
|
|
1031
1033
|
Object.assign(this.DOM, {
|
|
@@ -1070,7 +1072,7 @@
|
|
|
1070
1072
|
|
|
1071
1073
|
//set filter
|
|
1072
1074
|
this.DOM.bubbleCrown.selectAll(".vzb-crown-glow")
|
|
1073
|
-
.attr("filter",
|
|
1075
|
+
.attr("filter", `url(${location.pathname}#vzb-glow-filter-${this.id})`);
|
|
1074
1076
|
|
|
1075
1077
|
this._date = this.findChild({type: "DateTimeBackground"});
|
|
1076
1078
|
this._labels = this.findChild({type: "Labels"});
|
|
@@ -1089,6 +1091,7 @@
|
|
|
1089
1091
|
this.draggingNow = null;
|
|
1090
1092
|
|
|
1091
1093
|
this.hoverBubble = false;
|
|
1094
|
+
this.__lastStep = 0;
|
|
1092
1095
|
|
|
1093
1096
|
const _this = this;
|
|
1094
1097
|
//keyboard listeners
|
|
@@ -1209,10 +1212,12 @@
|
|
|
1209
1212
|
// this.addReaction(this._resetZoomMinMaxXReaction, this._resetZoomMinMaxX);
|
|
1210
1213
|
// this.addReaction(this._resetZoomMinMaxYReaction, this._resetZoomMinMaxY);
|
|
1211
1214
|
this.addReaction(this._updateOpacity);
|
|
1215
|
+
this.addReaction(this.updateColorPatterns);
|
|
1212
1216
|
this.addReaction(this._updateShowYear);
|
|
1213
1217
|
this.addReaction(this._updateYear);
|
|
1214
1218
|
this.addReaction(this.drawData);
|
|
1215
1219
|
this.addReaction(this._zoomToMarkerMaxMin);
|
|
1220
|
+
this.addReaction(this.redrawData);
|
|
1216
1221
|
|
|
1217
1222
|
this.addReaction(this._selectDataPoints);
|
|
1218
1223
|
this.addReaction(this._highlightDataPoints);
|
|
@@ -1229,6 +1234,41 @@
|
|
|
1229
1234
|
//this.redrawData();
|
|
1230
1235
|
}
|
|
1231
1236
|
|
|
1237
|
+
updateColorPatterns() {
|
|
1238
|
+
if (this.MDL.color.scale.isPattern) {
|
|
1239
|
+
const colorConcept = this.MDL.color.data.concept;
|
|
1240
|
+
this.DOM.defs.selectAll(".flag")
|
|
1241
|
+
.data(this.MDL.color.data.domainData, d => d[0])
|
|
1242
|
+
.enter()
|
|
1243
|
+
.append("pattern")
|
|
1244
|
+
.attr("id", d => `flag-${d[0]}-${this.id}`)
|
|
1245
|
+
.attr("class", "flag")
|
|
1246
|
+
.attr("width", "100%")
|
|
1247
|
+
.attr("height", "100%")
|
|
1248
|
+
.attr("patternContentUnits", "objectBoundingBox")
|
|
1249
|
+
.html(d => d[1][colorConcept])
|
|
1250
|
+
.each(function() {
|
|
1251
|
+
const svg = d3.select(this).select("svg");
|
|
1252
|
+
if (svg.empty()) return;
|
|
1253
|
+
|
|
1254
|
+
if (!svg.attr("viewBox"))
|
|
1255
|
+
svg.attr("viewBox", `0 0 ${svg.attr("width")} ${svg.attr("height")}`);
|
|
1256
|
+
|
|
1257
|
+
// xMidYMid: center the image in the circle
|
|
1258
|
+
// slice: scale the image to fill the circle
|
|
1259
|
+
if (!svg.attr("preserveAspectRatio"))
|
|
1260
|
+
svg.attr("preserveAspectRatio", "xMidYMid slice");
|
|
1261
|
+
|
|
1262
|
+
svg.attr("width", 1).attr("height", 1);
|
|
1263
|
+
});
|
|
1264
|
+
// .attr("xlink:href", function(d) {
|
|
1265
|
+
// return "flags/" + d.CountryCode + ".svg";
|
|
1266
|
+
// });
|
|
1267
|
+
} else {
|
|
1268
|
+
this.DOM.defs.selectAll(".flag").remove();
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1232
1272
|
_updateShowYear() {
|
|
1233
1273
|
this.DOM.date.classed("vzb-hidden", !this.ui.timeInBackground);
|
|
1234
1274
|
}
|
|
@@ -1238,11 +1278,20 @@
|
|
|
1238
1278
|
this._date.setText(this.MDL.frame.value, duration);
|
|
1239
1279
|
}
|
|
1240
1280
|
|
|
1281
|
+
__getColor(key, valueC) {
|
|
1282
|
+
return valueC != null ? (this.MDL.color.scale.isPattern ? `url(#flag-${key}-${this.id})` : this.cScale(valueC)) : COLOR_WHITEISH;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1241
1285
|
_createAndDeleteBubbles() {
|
|
1242
1286
|
const _this = this;
|
|
1243
1287
|
const duration = this._getDuration();
|
|
1244
1288
|
const transition = this._getTransition(duration);
|
|
1245
1289
|
const data = this.__dataProcessed;
|
|
1290
|
+
let trailRedrawDate;
|
|
1291
|
+
|
|
1292
|
+
mobx.runInAction(()=>{
|
|
1293
|
+
trailRedrawDate = this.MDL.frame.stepScale.invert(Math.min(this.__lastStep, this.__lastStep = this.MDL.frame.step << 0) - 1);
|
|
1294
|
+
});
|
|
1246
1295
|
|
|
1247
1296
|
this.bubbles = this.DOM.bubbleContainer.selectAll(".vzb-bc-entity")
|
|
1248
1297
|
.data(this.__dataProcessed, d => d[Symbol.for("key")])
|
|
@@ -1309,7 +1358,7 @@
|
|
|
1309
1358
|
d.r = VizabiSharedComponents.LegacyUtils.areaToRadius(_this.sScale(valueS || 0));
|
|
1310
1359
|
const scaledX = _this.xScale(valueX);
|
|
1311
1360
|
const scaledY = _this.yScale(valueY);
|
|
1312
|
-
const scaledC =
|
|
1361
|
+
const scaledC = _this.__getColor(d[Symbol.for(isTrail ? "trailHeadKey" : "key")], valueC);
|
|
1313
1362
|
|
|
1314
1363
|
if (!duration || !headTrail) {
|
|
1315
1364
|
circle
|
|
@@ -1339,10 +1388,10 @@
|
|
|
1339
1388
|
.attr("x1", scaledX)
|
|
1340
1389
|
.attr("y1", scaledY)
|
|
1341
1390
|
.attr("x2", scaledX0)
|
|
1342
|
-
.attr("y2", scaledY0)
|
|
1343
|
-
.style("stroke", scaledC)
|
|
1391
|
+
.attr("y2", scaledY0)
|
|
1344
1392
|
.attr("stroke-dasharray", Math.abs(scaledX - scaledX0) + Math.abs(scaledY - scaledY0))
|
|
1345
|
-
.attr("stroke-dashoffset", -d.r)
|
|
1393
|
+
.attr("stroke-dashoffset", -d.r)
|
|
1394
|
+
.style("stroke", _this.MDL.color.scale.isPattern ? null : scaledC);
|
|
1346
1395
|
}
|
|
1347
1396
|
}
|
|
1348
1397
|
|
|
@@ -1364,13 +1413,11 @@
|
|
|
1364
1413
|
const isTrail = isTrailBubble(d);
|
|
1365
1414
|
const isExtrapolated = d[Symbol.for("extrapolated")];
|
|
1366
1415
|
const dataNext = data[index + 1] || {};
|
|
1367
|
-
const dataNext2 = data[index + 2] || {};
|
|
1368
1416
|
const headTrail = isTrail && !dataNext[Symbol.for("trailHeadKey")];
|
|
1369
|
-
const headTrail2 = isTrail && !dataNext2[Symbol.for("trailHeadKey")];
|
|
1370
1417
|
|
|
1371
1418
|
const valueS = d.size;
|
|
1372
1419
|
d.r = VizabiSharedComponents.LegacyUtils.areaToRadius(_this.sScale(valueS || 0));
|
|
1373
|
-
if (isTrail &&
|
|
1420
|
+
if (isTrail && d["frame"] < trailRedrawDate) return;
|
|
1374
1421
|
|
|
1375
1422
|
const valueX = d[_this._alias("x")];
|
|
1376
1423
|
const valueY = d[_this._alias("y")];
|
|
@@ -1381,21 +1428,26 @@
|
|
|
1381
1428
|
//view.classed("vzb-hidden", d.hidden);
|
|
1382
1429
|
const scaledX = _this.xScale(valueX);
|
|
1383
1430
|
const scaledY = _this.yScale(valueY);
|
|
1384
|
-
const scaledC =
|
|
1431
|
+
const scaledC = _this.__getColor(d[Symbol.for(isTrail ? "trailHeadKey" : "key")], valueC);
|
|
1385
1432
|
|
|
1433
|
+
const group = d3.select(this);
|
|
1386
1434
|
if (!duration || !headTrail) {
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
.
|
|
1396
|
-
|
|
1435
|
+
const circle = group.select("circle");
|
|
1436
|
+
if (duration && !isTrail) {
|
|
1437
|
+
circle.transition(transition)
|
|
1438
|
+
.attr("r", d.r)
|
|
1439
|
+
.attr("fill", scaledC)
|
|
1440
|
+
.attr("cy", scaledY)
|
|
1441
|
+
.attr("cx", scaledX);
|
|
1442
|
+
} else {
|
|
1443
|
+
circle.interrupt()
|
|
1444
|
+
.attr("r", d.r)
|
|
1445
|
+
.attr("fill", scaledC)
|
|
1446
|
+
.attr("cy", scaledY)
|
|
1447
|
+
.attr("cx", scaledX);
|
|
1448
|
+
}
|
|
1397
1449
|
|
|
1398
|
-
const diagonalLine =
|
|
1450
|
+
const diagonalLine = group.select(".vzb-diagonal-line");
|
|
1399
1451
|
diagonalLine
|
|
1400
1452
|
.classed("vzb-hidden", !isExtrapolated);
|
|
1401
1453
|
if(isExtrapolated){
|
|
@@ -1416,7 +1468,7 @@
|
|
|
1416
1468
|
|
|
1417
1469
|
//trail line
|
|
1418
1470
|
if (isTrail) {
|
|
1419
|
-
const trailLine =
|
|
1471
|
+
const trailLine = group.select(".vzb-trail-line");
|
|
1420
1472
|
const scaledX0 = _this.xScale(dataNext[_this._alias("x")]);
|
|
1421
1473
|
const scaledY0 = _this.yScale(dataNext[_this._alias("y")]);
|
|
1422
1474
|
|
|
@@ -1437,7 +1489,7 @@
|
|
|
1437
1489
|
}
|
|
1438
1490
|
|
|
1439
1491
|
trailLine
|
|
1440
|
-
.style("stroke", scaledC)
|
|
1492
|
+
.style("stroke", _this.MDL.color.scale.isPattern ? null : scaledC)
|
|
1441
1493
|
.attr("stroke-dasharray", Math.abs(scaledX - scaledX0) + Math.abs(scaledY - scaledY0))
|
|
1442
1494
|
.attr("stroke-dashoffset", -d.r);
|
|
1443
1495
|
}
|
|
@@ -1471,18 +1523,21 @@
|
|
|
1471
1523
|
|
|
1472
1524
|
|
|
1473
1525
|
redrawData(duration) {
|
|
1474
|
-
this.services.layout.size;
|
|
1475
|
-
this.MDL.x.scale.type;
|
|
1476
|
-
this.MDL.y.scale.type;
|
|
1526
|
+
//this.services.layout.size;
|
|
1527
|
+
//this.MDL.x.scale.type;
|
|
1528
|
+
//this.MDL.y.scale.type;
|
|
1477
1529
|
this.MDL.color.scale.type;
|
|
1478
1530
|
this.MDL.size.scale.type;
|
|
1479
1531
|
this.MDL.size.scale.extent;
|
|
1480
1532
|
|
|
1481
1533
|
const _this = this;
|
|
1482
1534
|
const data = this.__dataProcessed;
|
|
1535
|
+
const transition = this._getTransition(duration);
|
|
1483
1536
|
|
|
1484
1537
|
if (this.bubbles) this.bubbles.each(function(d, index) {
|
|
1485
1538
|
const isTrail = isTrailBubble(d);
|
|
1539
|
+
const dataNext = data[index + 1] || {};
|
|
1540
|
+
const headTrail = isTrail && !dataNext[Symbol.for("trailHeadKey")];
|
|
1486
1541
|
const isExtrapolated = d[Symbol.for("extrapolated")];
|
|
1487
1542
|
|
|
1488
1543
|
const valueX = d[_this._alias("x")];
|
|
@@ -1493,26 +1548,37 @@
|
|
|
1493
1548
|
d.r = VizabiSharedComponents.LegacyUtils.areaToRadius(_this.sScale(valueS || 0));
|
|
1494
1549
|
const scaledX = _this.xScale(valueX);
|
|
1495
1550
|
const scaledY = _this.yScale(valueY);
|
|
1496
|
-
const scaledC =
|
|
1551
|
+
const scaledC = _this.__getColor(d[Symbol.for(isTrail ? "trailHeadKey" : "key")], valueC);
|
|
1497
1552
|
|
|
1498
|
-
const
|
|
1499
|
-
d3.select(this)
|
|
1500
|
-
.transition()
|
|
1501
|
-
.duration(duration)
|
|
1502
|
-
: d3.select(this).interrupt();
|
|
1553
|
+
const group = d3.select(this);
|
|
1503
1554
|
|
|
1504
|
-
|
|
1505
|
-
.
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1555
|
+
if (duration && headTrail) {
|
|
1556
|
+
group.style("opacity", 0)
|
|
1557
|
+
.transition().delay(duration).duration(0)
|
|
1558
|
+
.style("opacity", d[Symbol.for("opacity")]);
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
const circle = group.select("circle");
|
|
1562
|
+
if (duration && !headTrail) {
|
|
1563
|
+
circle.transition(transition)
|
|
1564
|
+
.attr("r", d.r)
|
|
1565
|
+
.attr("fill", scaledC)
|
|
1566
|
+
.attr("cy", scaledY)
|
|
1567
|
+
.attr("cx", scaledX);
|
|
1568
|
+
} else {
|
|
1569
|
+
circle.interrupt()
|
|
1570
|
+
.attr("r", d.r)
|
|
1571
|
+
.attr("fill", scaledC)
|
|
1572
|
+
.attr("cy", scaledY)
|
|
1573
|
+
.attr("cx", scaledX);
|
|
1574
|
+
}
|
|
1509
1575
|
|
|
1510
|
-
const diagonalLine =
|
|
1576
|
+
const diagonalLine = group.select(".vzb-diagonal-line");
|
|
1511
1577
|
diagonalLine
|
|
1512
1578
|
.classed("vzb-hidden", !isExtrapolated);
|
|
1513
1579
|
if(isExtrapolated){
|
|
1514
|
-
if (duration){
|
|
1515
|
-
diagonalLine.transition()
|
|
1580
|
+
if (duration && !headTrail){
|
|
1581
|
+
diagonalLine.transition(transition)
|
|
1516
1582
|
.attr("x1", scaledX + d.r/Math.sqrt(2))
|
|
1517
1583
|
.attr("y1", scaledY + d.r/Math.sqrt(2))
|
|
1518
1584
|
.attr("x2", scaledX - d.r/Math.sqrt(2))
|
|
@@ -1528,11 +1594,10 @@
|
|
|
1528
1594
|
|
|
1529
1595
|
|
|
1530
1596
|
if (isTrail) {
|
|
1531
|
-
const trailLine = duration ?
|
|
1532
|
-
|
|
1533
|
-
.transition()
|
|
1534
|
-
|
|
1535
|
-
: d3.select(this).select(".vzb-trail-line").interrupt();
|
|
1597
|
+
const trailLine = (duration && !headTrail) ?
|
|
1598
|
+
group.select(".vzb-trail-line")
|
|
1599
|
+
.transition(transition)
|
|
1600
|
+
: group.select(".vzb-trail-line").interrupt();
|
|
1536
1601
|
|
|
1537
1602
|
const dataNext = data[index + 1];
|
|
1538
1603
|
const scaledX0 = _this.xScale(dataNext[_this._alias("x")]);
|
|
@@ -1543,13 +1608,13 @@
|
|
|
1543
1608
|
.attr("y1", scaledY)
|
|
1544
1609
|
.attr("x2", scaledX0)
|
|
1545
1610
|
.attr("y2", scaledY0)
|
|
1546
|
-
.style("stroke", scaledC)
|
|
1611
|
+
.style("stroke", _this.MDL.color.scale.isPattern ? null : scaledC)
|
|
1547
1612
|
.attr("stroke-dasharray", Math.abs(scaledX - scaledX0) + Math.abs(scaledY - scaledY0))
|
|
1548
1613
|
.attr("stroke-dashoffset", -d.r);
|
|
1549
1614
|
}
|
|
1550
1615
|
});
|
|
1551
1616
|
|
|
1552
|
-
_this._updateLabels();
|
|
1617
|
+
mobx.runInAction(() => _this._updateLabels(duration));
|
|
1553
1618
|
}
|
|
1554
1619
|
|
|
1555
1620
|
__getZoomed(type, zoomed, domain) {
|
|
@@ -1767,10 +1832,6 @@
|
|
|
1767
1832
|
const infoElHeight = this.profileConstants.infoElHeight;
|
|
1768
1833
|
const xAxisTitleBottomMargin = this.profileConstants.xAxisTitleBottomMargin;
|
|
1769
1834
|
|
|
1770
|
-
//labels
|
|
1771
|
-
this._labels.setCloseCrossHeight(_this.profileConstants.infoElHeight * 1.2);
|
|
1772
|
-
this._labels.setTooltipFontSize(_this.profileConstants.infoElHeight + "px");
|
|
1773
|
-
|
|
1774
1835
|
//stage
|
|
1775
1836
|
const height = this.height = (this.elementHeight - margin.top - margin.bottom) || 0;
|
|
1776
1837
|
const width = this.width = (this.elementWidth - margin.left * this.profileConstants.leftMarginRatio - margin.right) || 0;
|
|
@@ -2266,10 +2327,12 @@
|
|
|
2266
2327
|
if (highlightedFilter.markers.size === 1) {
|
|
2267
2328
|
const highlightedKey = highlightedFilter.markers.keys().next().value;
|
|
2268
2329
|
const d = Object.assign(this.model.dataMap.getByStr(highlightedKey));
|
|
2330
|
+
const selectedKey = d[Symbol.for("trailHeadKey")] || d[Symbol.for("key")];
|
|
2331
|
+
|
|
2269
2332
|
const x = _this.xScale(d[_this._alias("x")]);
|
|
2270
2333
|
const y = _this.yScale(d[_this._alias("y")]);
|
|
2271
2334
|
const s = d.r;
|
|
2272
|
-
const c =
|
|
2335
|
+
const c = _this.__getColor(selectedKey, d.color);
|
|
2273
2336
|
let entityOutOfView = false;
|
|
2274
2337
|
|
|
2275
2338
|
////const titles = _this._formatSTitleValues(values.size[utils.getKey(d, dataKeys.size)], values.color[utils.getKey(d, dataKeys.color)]);
|
|
@@ -2279,7 +2342,6 @@
|
|
|
2279
2342
|
}
|
|
2280
2343
|
|
|
2281
2344
|
//show tooltip
|
|
2282
|
-
const selectedKey = d[Symbol.for("trailHeadKey")] || d[Symbol.for("key")];
|
|
2283
2345
|
// const trailShow = this.MDL.trail.show;
|
|
2284
2346
|
// const trailStarts = this.MDL.trail.starts;
|
|
2285
2347
|
// const trailGroupDim = this.MDL.trail.groupDim;
|
|
@@ -2290,7 +2352,7 @@
|
|
|
2290
2352
|
let text = "";
|
|
2291
2353
|
|
|
2292
2354
|
text = isSelected ?
|
|
2293
|
-
!trailShow || isTailTrail || (!isTrail && !this.hoverBubble) ? "": this.localise(d
|
|
2355
|
+
!trailShow || isTailTrail || (!isTrail && !this.hoverBubble) ? "": this.localise(d[trailGroupDim])
|
|
2294
2356
|
:
|
|
2295
2357
|
this.__labelWithoutFrame(d);
|
|
2296
2358
|
|
|
@@ -2432,7 +2494,7 @@
|
|
|
2432
2494
|
}
|
|
2433
2495
|
}
|
|
2434
2496
|
|
|
2435
|
-
_updateLabels() {
|
|
2497
|
+
_updateLabels(duration) {
|
|
2436
2498
|
//console.log("updateLabels");
|
|
2437
2499
|
|
|
2438
2500
|
const selectedFilter = this.MDL.selected.data.filter;
|
|
@@ -2459,7 +2521,7 @@
|
|
|
2459
2521
|
cache.valueS0 = d.size;
|
|
2460
2522
|
cache.initTextBBox = null;
|
|
2461
2523
|
cache.initFontSize = null;
|
|
2462
|
-
this._labels.updateLabel({ [Symbol.for("key")]: key }, null, null, null, null, null, null, d.size_label);
|
|
2524
|
+
this._labels.updateLabel({ [Symbol.for("key")]: key }, null, null, null, null, null, null, d.size_label, duration);
|
|
2463
2525
|
}
|
|
2464
2526
|
}
|
|
2465
2527
|
|
|
@@ -2552,8 +2614,8 @@
|
|
|
2552
2614
|
placeholder: ".vzb-repeater",
|
|
2553
2615
|
model: marker,
|
|
2554
2616
|
options: {
|
|
2555
|
-
|
|
2556
|
-
|
|
2617
|
+
repeatedComponent: VizabiBubbleChart,
|
|
2618
|
+
repeatedComponentCssClass: "vzb-bubblechart"
|
|
2557
2619
|
},
|
|
2558
2620
|
name: "chart",
|
|
2559
2621
|
},{
|
|
@@ -2605,7 +2667,7 @@
|
|
|
2605
2667
|
}];
|
|
2606
2668
|
|
|
2607
2669
|
config.template = `
|
|
2608
|
-
<div class="vzb-repeater
|
|
2670
|
+
<div class="vzb-repeater"></div>
|
|
2609
2671
|
<div class="vzb-animationcontrols">
|
|
2610
2672
|
<div class="vzb-timeslider"></div>
|
|
2611
2673
|
<div class="vzb-speedslider"></div>
|
|
@@ -2684,7 +2746,7 @@
|
|
|
2684
2746
|
}
|
|
2685
2747
|
});
|
|
2686
2748
|
|
|
2687
|
-
BubbleChart.versionInfo = { version: "3.
|
|
2749
|
+
BubbleChart.versionInfo = { version: "3.14.1", build: 1645171739593, package: {"homepage":"https://github.com/vizabi/bubblechart#readme","name":"@vizabi/bubblechart","description":"Vizabi bubble chart"}, sharedComponents: VizabiSharedComponents.versionInfo};
|
|
2688
2750
|
|
|
2689
2751
|
return BubbleChart;
|
|
2690
2752
|
|