@eclipse-scout/chart 25.2.14 → 25.2.16
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
|
@@ -303,12 +303,14 @@ class AbstractSvgChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_2__.Abstr
|
|
|
303
303
|
width;
|
|
304
304
|
chartAnimationStopping;
|
|
305
305
|
$svg;
|
|
306
|
+
_nonValueClickHandler;
|
|
306
307
|
constructor(chart) {
|
|
307
308
|
super(chart);
|
|
308
309
|
this.chartBox = null;
|
|
309
310
|
this.clipId = 'Clip-' + _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.ObjectIdProvider.get().createUiSeqId();
|
|
310
311
|
this.maskId = 'Mask-' + _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.ObjectIdProvider.get().createUiSeqId();
|
|
311
312
|
this.suppressLegendBox = false;
|
|
313
|
+
this._nonValueClickHandler = this._onNonValueClick.bind(this);
|
|
312
314
|
}
|
|
313
315
|
static FONT_SIZE_SMALLEST = 'smallestFont';
|
|
314
316
|
static FONT_SIZE_SMALL = 'smallFont';
|
|
@@ -320,6 +322,7 @@ class AbstractSvgChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_2__.Abstr
|
|
|
320
322
|
_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.aria.role(this.$svg, 'img');
|
|
321
323
|
// labeling has to be done here because otherwise the svg is ignored
|
|
322
324
|
this.linkChartWithFieldLabel(this.$svg);
|
|
325
|
+
this.$svg.on('click', this._nonValueClickHandler);
|
|
323
326
|
}
|
|
324
327
|
this.firstOpaqueBackgroundColor = _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_0__.styles.getFirstOpaqueBackgroundColor(this.$svg);
|
|
325
328
|
// This works, because CSS specifies 100% width/height
|
|
@@ -407,6 +410,14 @@ class AbstractSvgChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_2__.Abstr
|
|
|
407
410
|
datasetIndex: datasetIndex
|
|
408
411
|
};
|
|
409
412
|
}
|
|
413
|
+
_onChartValueClick(event) {
|
|
414
|
+
this.chart.handleValueClick(event.data, event.originalEvent);
|
|
415
|
+
event.stopPropagation();
|
|
416
|
+
}
|
|
417
|
+
_onNonValueClick(event) {
|
|
418
|
+
this.chart.handleNonValueClick(event.originalEvent);
|
|
419
|
+
event.stopPropagation();
|
|
420
|
+
}
|
|
410
421
|
_measureText(text, legendLabelClass) {
|
|
411
422
|
let $label = this.$svg.appendSVG('text', legendLabelClass).attr('x', 0).attr('y', 0).attr('visibility', 'hidden').text(text);
|
|
412
423
|
let textBounds;
|
|
@@ -1035,6 +1046,17 @@ class Chart extends _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_1__.Widget {
|
|
|
1035
1046
|
originalEvent
|
|
1036
1047
|
});
|
|
1037
1048
|
}
|
|
1049
|
+
handleNonValueClick(originalEvent) {
|
|
1050
|
+
this.trigger('nonValueClick', {
|
|
1051
|
+
originalEvent
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
handleLegendClick(legentItemIndex, originalEvent) {
|
|
1055
|
+
this.trigger('legendItemClick', {
|
|
1056
|
+
legendItemIndex: legentItemIndex,
|
|
1057
|
+
originalEvent: originalEvent
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1038
1060
|
}
|
|
1039
1061
|
/**
|
|
1040
1062
|
* Determines what parts of the chart data is colored with the same colors.
|
|
@@ -1233,6 +1255,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
1233
1255
|
_tooltip;
|
|
1234
1256
|
_tooltipTimeoutId;
|
|
1235
1257
|
_updatingDatalabels;
|
|
1258
|
+
_hoveringClickableElement;
|
|
1236
1259
|
constructor(chart) {
|
|
1237
1260
|
super(chart);
|
|
1238
1261
|
this.chartJs = null;
|
|
@@ -1333,6 +1356,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
1333
1356
|
_render() {
|
|
1334
1357
|
if (!this.$canvas) {
|
|
1335
1358
|
this.$canvas = this.chart.$container.appendElement('<canvas>');
|
|
1359
|
+
this.$canvas.on('click', this._onCanvasClick.bind(this));
|
|
1336
1360
|
_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_3__.aria.hidden(this.$canvas, true); // aria not supported yet
|
|
1337
1361
|
}
|
|
1338
1362
|
this.firstOpaqueBackgroundColor = _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_3__.styles.getFirstOpaqueBackgroundColor(this.$canvas);
|
|
@@ -3127,12 +3151,24 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3127
3151
|
legend.onLeave = this._legendLeaveHandler;
|
|
3128
3152
|
}
|
|
3129
3153
|
}
|
|
3154
|
+
_onCanvasClick(event) {
|
|
3155
|
+
// Clicks on e.g. the axes don't trigger the onClickHandler of the chartJs Chart.
|
|
3156
|
+
// 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.
|
|
3157
|
+
// If no item is present, a click in the chart but outside an element was made and a corresponding event gets triggered.
|
|
3158
|
+
// Clicks on elements are handled in a separate method (see this#_onClick)
|
|
3159
|
+
if (!this._hoveringClickableElement) {
|
|
3160
|
+
this.chart.handleNonValueClick(event.originalEvent);
|
|
3161
|
+
}
|
|
3162
|
+
event.originalEvent.stopPropagation();
|
|
3163
|
+
}
|
|
3130
3164
|
_onClick(event, items) {
|
|
3131
3165
|
if (!items.length) {
|
|
3166
|
+
this.chart.handleNonValueClick(event.native);
|
|
3132
3167
|
return;
|
|
3133
3168
|
}
|
|
3134
3169
|
let relevantItem = this._selectRelevantItem(items);
|
|
3135
3170
|
if (this._isMaxSegmentsExceeded(this.chartJs.config, relevantItem.index)) {
|
|
3171
|
+
this.chart.handleNonValueClick(event.native);
|
|
3136
3172
|
return;
|
|
3137
3173
|
}
|
|
3138
3174
|
let itemIndex = relevantItem.index,
|
|
@@ -3200,13 +3236,16 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3200
3236
|
return;
|
|
3201
3237
|
}
|
|
3202
3238
|
if (items.length && !this._isMaxSegmentsExceeded(this.chartJs.config, items[0].index)) {
|
|
3239
|
+
this._hoveringClickableElement = true;
|
|
3203
3240
|
this.$canvas.css('cursor', 'pointer');
|
|
3204
3241
|
} else {
|
|
3242
|
+
this._hoveringClickableElement = false;
|
|
3205
3243
|
this.$canvas.css('cursor', 'default');
|
|
3206
3244
|
}
|
|
3207
3245
|
}
|
|
3208
3246
|
_onLegendClick(e, legendItem, legend) {
|
|
3209
3247
|
if (!this.chartJs.config || !this.chartJs.config.type) {
|
|
3248
|
+
this.chart.handleNonValueClick(e.native);
|
|
3210
3249
|
return;
|
|
3211
3250
|
}
|
|
3212
3251
|
let type = this.chartJs.config.type,
|
|
@@ -3222,6 +3261,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3222
3261
|
isDatasetVisible: i => this.chartJs.getDatasetMeta(i).visible
|
|
3223
3262
|
});
|
|
3224
3263
|
this.refresh();
|
|
3264
|
+
this.chart.handleLegendClick(legendItem.datasetIndex, e.native);
|
|
3225
3265
|
}
|
|
3226
3266
|
_onLegendHover(e, legendItem, legend) {
|
|
3227
3267
|
let index = legendItem.datasetIndex,
|
|
@@ -3248,6 +3288,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3248
3288
|
if (!this.rendered || this.removing) {
|
|
3249
3289
|
return;
|
|
3250
3290
|
}
|
|
3291
|
+
this._hoveringClickableElement = true;
|
|
3251
3292
|
this.$canvas.css('cursor', 'pointer');
|
|
3252
3293
|
}
|
|
3253
3294
|
_onLegendLeave(e, legendItem, legend) {
|
|
@@ -3304,6 +3345,7 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
|
|
|
3304
3345
|
if (!this.rendered || this.removing) {
|
|
3305
3346
|
return;
|
|
3306
3347
|
}
|
|
3348
|
+
this._hoveringClickableElement = false;
|
|
3307
3349
|
this.$canvas.css('cursor', 'default');
|
|
3308
3350
|
}
|
|
3309
3351
|
_updateHoverStyle(datasetIndex, enabled) {
|
|
@@ -3875,7 +3917,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3875
3917
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery */ "jquery");
|
|
3876
3918
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_2__);
|
|
3877
3919
|
/*
|
|
3878
|
-
* Copyright (c) 2010,
|
|
3920
|
+
* Copyright (c) 2010, 2025 BSI Business Systems Integration AG
|
|
3879
3921
|
*
|
|
3880
3922
|
* This program and the accompanying materials are made
|
|
3881
3923
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -3957,7 +3999,7 @@ class FulfillmentChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_1__.Abstr
|
|
|
3957
3999
|
.attr('dy', '0.3em') // workaround for 'dominant-baseline: central' which is not supported in IE
|
|
3958
4000
|
.attrXLINK('href', '#InnerCircle').text(percentage + '%');
|
|
3959
4001
|
if (this.chart.config.options.clickable) {
|
|
3960
|
-
$arc.on('click', this._createClickObject(null, null),
|
|
4002
|
+
$arc.on('click', this._createClickObject(null, null), this._onChartValueClick.bind(this));
|
|
3961
4003
|
}
|
|
3962
4004
|
if (!this.chart.config.options.autoColor && !chartGroupCss) {
|
|
3963
4005
|
$arc.attr('fill', color);
|
|
@@ -4054,7 +4096,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4054
4096
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery */ "jquery");
|
|
4055
4097
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_2__);
|
|
4056
4098
|
/*
|
|
4057
|
-
* Copyright (c) 2010,
|
|
4099
|
+
* Copyright (c) 2010, 2025 BSI Business Systems Integration AG
|
|
4058
4100
|
*
|
|
4059
4101
|
* This program and the accompanying materials are made
|
|
4060
4102
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -4264,7 +4306,7 @@ class SalesfunnelChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_1__.Abstr
|
|
|
4264
4306
|
}, this._createAnimationObjectWithTabIndexRemoval(expandFunc, this.animationDuration));
|
|
4265
4307
|
}
|
|
4266
4308
|
if (this.chart.config.options.clickable) {
|
|
4267
|
-
$poly.on('click', renderPolyOptions.clickObject,
|
|
4309
|
+
$poly.on('click', renderPolyOptions.clickObject, this._onChartValueClick.bind(this));
|
|
4268
4310
|
}
|
|
4269
4311
|
if (renderPolyOptions.fill) {
|
|
4270
4312
|
$poly.attr('fill', renderPolyOptions.fill);
|
|
@@ -4432,7 +4474,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
4432
4474
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
4433
4475
|
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); }
|
|
4434
4476
|
/*
|
|
4435
|
-
* Copyright (c) 2010,
|
|
4477
|
+
* Copyright (c) 2010, 2025 BSI Business Systems Integration AG
|
|
4436
4478
|
*
|
|
4437
4479
|
* This program and the accompanying materials are made
|
|
4438
4480
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -4526,7 +4568,8 @@ class SpeedoChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_1__.AbstractSv
|
|
|
4526
4568
|
this._renderLegend(minValue, value, maxValue, chartData.chartValueGroups[0].groupName);
|
|
4527
4569
|
this.$svg.addClass('speedo-chart-svg');
|
|
4528
4570
|
if (this.chart.config.options.clickable) {
|
|
4529
|
-
this.$svg.
|
|
4571
|
+
this.$svg.off('click', this._nonValueClickHandler);
|
|
4572
|
+
this.$svg.on('click', this._createClickObject(null, null), this._onChartValueClick.bind(this));
|
|
4530
4573
|
}
|
|
4531
4574
|
}
|
|
4532
4575
|
_getValuePercentage(value, minValue, maxValue) {
|
|
@@ -5024,7 +5067,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5024
5067
|
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);
|
|
5025
5068
|
/* harmony import */ var _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @eclipse-scout/core */ "@eclipse-scout/core");
|
|
5026
5069
|
/*
|
|
5027
|
-
* Copyright (c) 2010,
|
|
5070
|
+
* Copyright (c) 2010, 2025 BSI Business Systems Integration AG
|
|
5028
5071
|
*
|
|
5029
5072
|
* This program and the accompanying materials are made
|
|
5030
5073
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -5339,7 +5382,7 @@ class VennChartRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractSvgC
|
|
|
5339
5382
|
$circle.attr('fill', color);
|
|
5340
5383
|
}
|
|
5341
5384
|
if (this.chart.config.options.clickable) {
|
|
5342
|
-
$circle.on('click', this._createClickObject(null, circleIndex),
|
|
5385
|
+
$circle.on('click', this._createClickObject(null, circleIndex), this._onChartValueClick.bind(this));
|
|
5343
5386
|
}
|
|
5344
5387
|
return $circle;
|
|
5345
5388
|
}
|