@eclipse-scout/chart 25.2.12 → 25.2.15
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/dist/cyclonedx/bom.json +6 -6
- package/dist/cyclonedx/bom.xml +6 -6
- package/dist/d.ts/src/chart/AbstractSvgChartRenderer.d.ts +3 -0
- package/dist/d.ts/src/chart/AbstractSvgChartRenderer.d.ts.map +1 -1
- package/dist/d.ts/src/chart/Chart.d.ts +2 -0
- package/dist/d.ts/src/chart/Chart.d.ts.map +1 -1
- package/dist/d.ts/src/chart/ChartEventMap.d.ts +9 -0
- package/dist/d.ts/src/chart/ChartEventMap.d.ts.map +1 -1
- package/dist/d.ts/src/chart/ChartJsRenderer.d.ts +3 -0
- package/dist/d.ts/src/chart/ChartJsRenderer.d.ts.map +1 -1
- package/dist/d.ts/src/chart/SpeedoChartRenderer.d.ts.map +1 -1
- package/dist/eclipse-scout-chart-56b0db398b6cbb5db250.min.js +3 -0
- package/dist/eclipse-scout-chart-56b0db398b6cbb5db250.min.js.map +1 -0
- package/dist/eclipse-scout-chart.esm-d3fe89eef3a7e7a32596.min.js +3 -0
- package/dist/eclipse-scout-chart.esm-d3fe89eef3a7e7a32596.min.js.map +1 -0
- package/dist/eclipse-scout-chart.esm.js +51 -8
- package/dist/eclipse-scout-chart.esm.js.map +1 -1
- package/dist/eclipse-scout-chart.js +51 -8
- package/dist/eclipse-scout-chart.js.map +1 -1
- package/dist/file-list +4 -4
- package/package.json +3 -3
- package/src/chart/AbstractSvgChartRenderer.ts +15 -0
- package/src/chart/Chart.ts +13 -0
- package/src/chart/ChartEventMap.ts +12 -1
- package/src/chart/ChartJsRenderer.ts +21 -0
- package/src/chart/FulfillmentChartRenderer.ts +2 -2
- package/src/chart/SalesfunnelChartRenderer.ts +2 -2
- package/src/chart/SpeedoChartRenderer.ts +3 -2
- package/src/chart/VennChartRenderer.ts +2 -2
- package/dist/eclipse-scout-chart-d331b1b85545869cd175.min.js +0 -3
- package/dist/eclipse-scout-chart-d331b1b85545869cd175.min.js.map +0 -1
- package/dist/eclipse-scout-chart.esm-282c94cab1a5918c5856.min.js +0 -3
- package/dist/eclipse-scout-chart.esm-282c94cab1a5918c5856.min.js.map +0 -1
|
@@ -304,12 +304,14 @@ class AbstractSvgChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_2__.Abstr
|
|
|
304
304
|
width;
|
|
305
305
|
chartAnimationStopping;
|
|
306
306
|
$svg;
|
|
307
|
+
_nonValueClickHandler;
|
|
307
308
|
constructor(chart) {
|
|
308
309
|
super(chart);
|
|
309
310
|
this.chartBox = null;
|
|
310
311
|
this.clipId = 'Clip-' + _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.ObjectIdProvider.get().createUiSeqId();
|
|
311
312
|
this.maskId = 'Mask-' + _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.ObjectIdProvider.get().createUiSeqId();
|
|
312
313
|
this.suppressLegendBox = false;
|
|
314
|
+
this._nonValueClickHandler = this._onNonValueClick.bind(this);
|
|
313
315
|
}
|
|
314
316
|
static FONT_SIZE_SMALLEST = 'smallestFont';
|
|
315
317
|
static FONT_SIZE_SMALL = 'smallFont';
|
|
@@ -321,6 +323,7 @@ class AbstractSvgChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_2__.Abstr
|
|
|
321
323
|
_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.aria.role(this.$svg, 'img');
|
|
322
324
|
// labeling has to be done here because otherwise the svg is ignored
|
|
323
325
|
this.linkChartWithFieldLabel(this.$svg);
|
|
326
|
+
this.$svg.on('click', this._nonValueClickHandler);
|
|
324
327
|
}
|
|
325
328
|
this.firstOpaqueBackgroundColor = _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.styles.getFirstOpaqueBackgroundColor(this.$svg);
|
|
326
329
|
// This works, because CSS specifies 100% width/height
|
|
@@ -408,6 +411,14 @@ class AbstractSvgChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_2__.Abstr
|
|
|
408
411
|
datasetIndex: datasetIndex
|
|
409
412
|
};
|
|
410
413
|
}
|
|
414
|
+
_onChartValueClick(event) {
|
|
415
|
+
this.chart.handleValueClick(event.data, event.originalEvent);
|
|
416
|
+
event.stopPropagation();
|
|
417
|
+
}
|
|
418
|
+
_onNonValueClick(event) {
|
|
419
|
+
this.chart.handleNonValueClick(event.originalEvent);
|
|
420
|
+
event.stopPropagation();
|
|
421
|
+
}
|
|
411
422
|
_measureText(text, legendLabelClass) {
|
|
412
423
|
let $label = this.$svg.appendSVG('text', legendLabelClass).attr('x', 0).attr('y', 0).attr('visibility', 'hidden').text(text);
|
|
413
424
|
let textBounds;
|
|
@@ -1037,6 +1048,17 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
|
|
|
1037
1048
|
originalEvent
|
|
1038
1049
|
});
|
|
1039
1050
|
}
|
|
1051
|
+
handleNonValueClick(originalEvent) {
|
|
1052
|
+
this.trigger('nonValueClick', {
|
|
1053
|
+
originalEvent
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
handleLegendClick(legentItemIndex, originalEvent) {
|
|
1057
|
+
this.trigger('legendItemClick', {
|
|
1058
|
+
legendItemIndex: legentItemIndex,
|
|
1059
|
+
originalEvent: originalEvent
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1040
1062
|
}
|
|
1041
1063
|
/**
|
|
1042
1064
|
* Determines what parts of the chart data is colored with the same colors.
|
|
@@ -1238,6 +1260,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
1238
1260
|
_tooltip;
|
|
1239
1261
|
_tooltipTimeoutId;
|
|
1240
1262
|
_updatingDatalabels;
|
|
1263
|
+
_hoveringClickableElement;
|
|
1241
1264
|
constructor(chart) {
|
|
1242
1265
|
super(chart);
|
|
1243
1266
|
this.chartJs = null;
|
|
@@ -1338,6 +1361,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
1338
1361
|
_render() {
|
|
1339
1362
|
if (!this.$canvas) {
|
|
1340
1363
|
this.$canvas = this.chart.$container.appendElement('<canvas>');
|
|
1364
|
+
this.$canvas.on('click', this._onCanvasClick.bind(this));
|
|
1341
1365
|
_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.aria.hidden(this.$canvas, true); // aria not supported yet
|
|
1342
1366
|
}
|
|
1343
1367
|
this.firstOpaqueBackgroundColor = _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.styles.getFirstOpaqueBackgroundColor(this.$canvas);
|
|
@@ -3132,12 +3156,24 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3132
3156
|
legend.onLeave = this._legendLeaveHandler;
|
|
3133
3157
|
}
|
|
3134
3158
|
}
|
|
3159
|
+
_onCanvasClick(event) {
|
|
3160
|
+
// Clicks on e.g. the axes don't trigger the onClickHandler of the chartJs Chart.
|
|
3161
|
+
// To register additional actions depending on the area clicked and to cover the whole canvas, the clicks outside an element must already be processed here.
|
|
3162
|
+
// If no item is present, a click in the chart but outside an element was made and a corresponding event gets triggered.
|
|
3163
|
+
// Clicks on elements are handled in a separate method (see this#_onClick)
|
|
3164
|
+
if (!this._hoveringClickableElement) {
|
|
3165
|
+
this.chart.handleNonValueClick(event.originalEvent);
|
|
3166
|
+
}
|
|
3167
|
+
event.originalEvent.stopPropagation();
|
|
3168
|
+
}
|
|
3135
3169
|
_onClick(event, items) {
|
|
3136
3170
|
if (!items.length) {
|
|
3171
|
+
this.chart.handleNonValueClick(event.native);
|
|
3137
3172
|
return;
|
|
3138
3173
|
}
|
|
3139
3174
|
let relevantItem = this._selectRelevantItem(items);
|
|
3140
3175
|
if (this._isMaxSegmentsExceeded(this.chartJs.config, relevantItem.index)) {
|
|
3176
|
+
this.chart.handleNonValueClick(event.native);
|
|
3141
3177
|
return;
|
|
3142
3178
|
}
|
|
3143
3179
|
let itemIndex = relevantItem.index,
|
|
@@ -3205,13 +3241,16 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3205
3241
|
return;
|
|
3206
3242
|
}
|
|
3207
3243
|
if (items.length && !this._isMaxSegmentsExceeded(this.chartJs.config, items[0].index)) {
|
|
3244
|
+
this._hoveringClickableElement = true;
|
|
3208
3245
|
this.$canvas.css('cursor', 'pointer');
|
|
3209
3246
|
} else {
|
|
3247
|
+
this._hoveringClickableElement = false;
|
|
3210
3248
|
this.$canvas.css('cursor', 'default');
|
|
3211
3249
|
}
|
|
3212
3250
|
}
|
|
3213
3251
|
_onLegendClick(e, legendItem, legend) {
|
|
3214
3252
|
if (!this.chartJs.config || !this.chartJs.config.type) {
|
|
3253
|
+
this.chart.handleNonValueClick(e.native);
|
|
3215
3254
|
return;
|
|
3216
3255
|
}
|
|
3217
3256
|
let type = this.chartJs.config.type,
|
|
@@ -3227,6 +3266,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3227
3266
|
isDatasetVisible: i => this.chartJs.getDatasetMeta(i).visible
|
|
3228
3267
|
});
|
|
3229
3268
|
this.refresh();
|
|
3269
|
+
this.chart.handleLegendClick(legendItem.datasetIndex, e.native);
|
|
3230
3270
|
}
|
|
3231
3271
|
_onLegendHover(e, legendItem, legend) {
|
|
3232
3272
|
let index = legendItem.datasetIndex,
|
|
@@ -3253,6 +3293,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3253
3293
|
if (!this.rendered || this.removing) {
|
|
3254
3294
|
return;
|
|
3255
3295
|
}
|
|
3296
|
+
this._hoveringClickableElement = true;
|
|
3256
3297
|
this.$canvas.css('cursor', 'pointer');
|
|
3257
3298
|
}
|
|
3258
3299
|
_onLegendLeave(e, legendItem, legend) {
|
|
@@ -3309,6 +3350,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3309
3350
|
if (!this.rendered || this.removing) {
|
|
3310
3351
|
return;
|
|
3311
3352
|
}
|
|
3353
|
+
this._hoveringClickableElement = false;
|
|
3312
3354
|
this.$canvas.css('cursor', 'default');
|
|
3313
3355
|
}
|
|
3314
3356
|
_updateHoverStyle(datasetIndex, enabled) {
|
|
@@ -3882,7 +3924,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3882
3924
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery */ "jquery");
|
|
3883
3925
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_2__);
|
|
3884
3926
|
/*
|
|
3885
|
-
* Copyright (c) 2010,
|
|
3927
|
+
* Copyright (c) 2010, 2025 BSI Business Systems Integration AG
|
|
3886
3928
|
*
|
|
3887
3929
|
* This program and the accompanying materials are made
|
|
3888
3930
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -3964,7 +4006,7 @@ class FulfillmentChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_1__.Abstr
|
|
|
3964
4006
|
.attr('dy', '0.3em') // workaround for 'dominant-baseline: central' which is not supported in IE
|
|
3965
4007
|
.attrXLINK('href', '#InnerCircle').text(percentage + '%');
|
|
3966
4008
|
if (this.chart.config.options.clickable) {
|
|
3967
|
-
$arc.on('click', this._createClickObject(null, null),
|
|
4009
|
+
$arc.on('click', this._createClickObject(null, null), this._onChartValueClick.bind(this));
|
|
3968
4010
|
}
|
|
3969
4011
|
if (!this.chart.config.options.autoColor && !chartGroupCss) {
|
|
3970
4012
|
$arc.attr('fill', color);
|
|
@@ -4062,7 +4104,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4062
4104
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery */ "jquery");
|
|
4063
4105
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_2__);
|
|
4064
4106
|
/*
|
|
4065
|
-
* Copyright (c) 2010,
|
|
4107
|
+
* Copyright (c) 2010, 2025 BSI Business Systems Integration AG
|
|
4066
4108
|
*
|
|
4067
4109
|
* This program and the accompanying materials are made
|
|
4068
4110
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -4272,7 +4314,7 @@ class SalesfunnelChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_1__.Abstr
|
|
|
4272
4314
|
}, this._createAnimationObjectWithTabIndexRemoval(expandFunc, this.animationDuration));
|
|
4273
4315
|
}
|
|
4274
4316
|
if (this.chart.config.options.clickable) {
|
|
4275
|
-
$poly.on('click', renderPolyOptions.clickObject,
|
|
4317
|
+
$poly.on('click', renderPolyOptions.clickObject, this._onChartValueClick.bind(this));
|
|
4276
4318
|
}
|
|
4277
4319
|
if (renderPolyOptions.fill) {
|
|
4278
4320
|
$poly.attr('fill', renderPolyOptions.fill);
|
|
@@ -4441,7 +4483,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
4441
4483
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4442
4484
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4443
4485
|
/*
|
|
4444
|
-
* Copyright (c) 2010,
|
|
4486
|
+
* Copyright (c) 2010, 2025 BSI Business Systems Integration AG
|
|
4445
4487
|
*
|
|
4446
4488
|
* This program and the accompanying materials are made
|
|
4447
4489
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -4535,7 +4577,8 @@ class SpeedoChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_1__.AbstractSv
|
|
|
4535
4577
|
this._renderLegend(minValue, value, maxValue, chartData.chartValueGroups[0].groupName);
|
|
4536
4578
|
this.$svg.addClass('speedo-chart-svg');
|
|
4537
4579
|
if (this.chart.config.options.clickable) {
|
|
4538
|
-
this.$svg.
|
|
4580
|
+
this.$svg.off('click', this._nonValueClickHandler);
|
|
4581
|
+
this.$svg.on('click', this._createClickObject(null, null), this._onChartValueClick.bind(this));
|
|
4539
4582
|
}
|
|
4540
4583
|
}
|
|
4541
4584
|
_getValuePercentage(value, minValue, maxValue) {
|
|
@@ -5034,7 +5077,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5034
5077
|
/* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @eclipse-scout/core */ "@eclipse-scout/core");
|
|
5035
5078
|
/* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__);
|
|
5036
5079
|
/*
|
|
5037
|
-
* Copyright (c) 2010,
|
|
5080
|
+
* Copyright (c) 2010, 2025 BSI Business Systems Integration AG
|
|
5038
5081
|
*
|
|
5039
5082
|
* This program and the accompanying materials are made
|
|
5040
5083
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -5349,7 +5392,7 @@ class VennChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractSvgC
|
|
|
5349
5392
|
$circle.attr('fill', color);
|
|
5350
5393
|
}
|
|
5351
5394
|
if (this.chart.config.options.clickable) {
|
|
5352
|
-
$circle.on('click', this._createClickObject(null, circleIndex),
|
|
5395
|
+
$circle.on('click', this._createClickObject(null, circleIndex), this._onChartValueClick.bind(this));
|
|
5353
5396
|
}
|
|
5354
5397
|
return $circle;
|
|
5355
5398
|
}
|