@progress/kendo-charts 2.6.3-dev.202411221249 → 2.7.0-dev.202501020821

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.
Files changed (34) hide show
  1. package/dist/cdn/js/kendo-charts.js +1 -1
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/chart/bar-chart/bar.js +1 -1
  4. package/dist/es/chart/bubble-chart/bubble.js +1 -1
  5. package/dist/es/chart/chart.js +13 -15
  6. package/dist/es/chart/funnel-chart/funnel-segment.js +1 -1
  7. package/dist/es/chart/heatmap-chart/heatmap-point.js +1 -1
  8. package/dist/es/chart/legend/legend.js +2 -1
  9. package/dist/es/chart/line-chart/line-point.js +1 -1
  10. package/dist/es/chart/pie-chart/pie-segment.js +1 -1
  11. package/dist/es/chart/tooltip/base-tooltip.js +3 -0
  12. package/dist/es/core/chart-element.js +1 -1
  13. package/dist/es/sankey/link.js +1 -1
  14. package/dist/es/sankey/node.js +1 -1
  15. package/dist/es/sankey/sankey.js +8 -3
  16. package/dist/es2015/chart/bar-chart/bar.js +1 -1
  17. package/dist/es2015/chart/bubble-chart/bubble.js +1 -1
  18. package/dist/es2015/chart/chart.js +13 -15
  19. package/dist/es2015/chart/funnel-chart/funnel-segment.js +1 -1
  20. package/dist/es2015/chart/heatmap-chart/heatmap-point.js +1 -1
  21. package/dist/es2015/chart/legend/legend.js +2 -1
  22. package/dist/es2015/chart/line-chart/line-point.js +1 -1
  23. package/dist/es2015/chart/pie-chart/pie-segment.js +1 -1
  24. package/dist/es2015/chart/tooltip/base-tooltip.js +3 -0
  25. package/dist/es2015/core/chart-element.js +1 -1
  26. package/dist/es2015/sankey/link.js +1 -1
  27. package/dist/es2015/sankey/node.js +1 -1
  28. package/dist/es2015/sankey/sankey.js +8 -3
  29. package/dist/npm/field-types/focus-highlight.interface.d.ts +23 -0
  30. package/dist/npm/field-types.d.ts +1 -0
  31. package/dist/npm/main.js +36 -29
  32. package/dist/npm/sankey.d.ts +2 -11
  33. package/dist/systemjs/kendo-charts.js +1 -1
  34. package/package.json +1 -1
@@ -211,7 +211,7 @@ var Bar = (function (ChartElement) {
211
211
  };
212
212
 
213
213
  Bar.prototype.createFocusHighlight = function createFocusHighlight (style) {
214
- var borderWidth = this.options.accessibility.highlight.border.width;
214
+ var borderWidth = this.options.focusHighlight.border.width;
215
215
  var highlight = draw.Path.fromRect(this.box.pad(borderWidth / 2).toRect(), style);
216
216
 
217
217
  return alignPathToPixel(highlight);
@@ -62,7 +62,7 @@ var Bubble = (function (LinePoint) {
62
62
  };
63
63
 
64
64
  Bubble.prototype.createFocusHighlight = function createFocusHighlight (style) {
65
- var highlightOptions = this.options.accessibility.highlight;
65
+ var highlightOptions = this.options.focusHighlight;
66
66
  var markers = this.options.markers;
67
67
  var center = this.box.center();
68
68
  var radius = (markers.size + markers.border.width) / 2 + highlightOptions.border.width / 2;
@@ -2331,13 +2331,12 @@ setDefaultOptions(Chart, {
2331
2331
  legend: {
2332
2332
  visible: true,
2333
2333
  labels: {},
2334
- accessibility: {
2335
- highlight: {
2336
- border: {
2337
- opacity: 1,
2338
- color: BLACK,
2339
- width: 2
2340
- }
2334
+ accessibility: {},
2335
+ focusHighlight: {
2336
+ border: {
2337
+ opacity: 1,
2338
+ color: BLACK,
2339
+ width: 2
2341
2340
  }
2342
2341
  }
2343
2342
  },
@@ -2352,14 +2351,13 @@ setDefaultOptions(Chart, {
2352
2351
  negativeValues: {
2353
2352
  visible: false
2354
2353
  },
2355
- accessibility: {
2356
- highlight: {
2357
- border: {
2358
- opacity: 1,
2359
- width: 2
2360
- },
2361
- zIndex: 200
2362
- }
2354
+ accessibility: {},
2355
+ focusHighlight: {
2356
+ border: {
2357
+ opacity: 1,
2358
+ width: 2
2359
+ },
2360
+ zIndex: 200
2363
2361
  }
2364
2362
  },
2365
2363
  series: [],
@@ -113,7 +113,7 @@ var FunnelSegment = (function (ChartElement) {
113
113
  };
114
114
 
115
115
  FunnelSegment.prototype.createFocusHighlight = function createFocusHighlight (style) {
116
- var borderWidth = this.options.accessibility.highlight.border.width;
116
+ var borderWidth = this.options.focusHighlight.border.width;
117
117
  var result = draw.Path.fromPoints(this.points, deepExtend({}, style, {
118
118
  stroke: {
119
119
  width: borderWidth * 2
@@ -208,7 +208,7 @@ var HeatmapPoint = (function (ChartElement) {
208
208
 
209
209
  HeatmapPoint.prototype.createFocusHighlight = function createFocusHighlight () {
210
210
  var markerOptions = this.options.markers;
211
- var highlightOptions = this.options.accessibility.highlight;
211
+ var highlightOptions = this.options.focusHighlight;
212
212
 
213
213
  var highlight = new ShapeElement({
214
214
  type: valueOrDefault(markerOptions.type, 'rect'),
@@ -119,7 +119,8 @@ var Legend = (function (ChartElement) {
119
119
  area: Object.assign({}, {opacity: opacity},
120
120
  options.area),
121
121
  opacity: opacity,
122
- accessibility: options.accessibility
122
+ accessibility: options.accessibility,
123
+ focusHighlight: options.focusHighlight
123
124
  },
124
125
  options.item,
125
126
  legendItem,
@@ -265,7 +265,7 @@ var LinePoint = (function (ChartElement) {
265
265
 
266
266
  LinePoint.prototype.createFocusHighlight = function createFocusHighlight () {
267
267
  var markerOptions = this.options.markers;
268
- var highlightOptions = this.options.accessibility.highlight;
268
+ var highlightOptions = this.options.focusHighlight;
269
269
  var size = markerOptions.size + (markerOptions.border.width || 0);
270
270
 
271
271
  var highlight = new ShapeElement({
@@ -261,7 +261,7 @@ var PieSegment = (function (ChartElement) {
261
261
  };
262
262
 
263
263
  PieSegment.prototype.createFocusHighlight = function createFocusHighlight (style) {
264
- var borderWidth = this.options.accessibility.highlight.border.width;
264
+ var borderWidth = this.options.focusHighlight.border.width;
265
265
  var result = this.createSegment(this.sector, deepExtend({}, style, {
266
266
  stroke: {
267
267
  width: borderWidth * 2
@@ -49,6 +49,9 @@ var BaseTooltip = (function (Class) {
49
49
  };
50
50
 
51
51
  BaseTooltip.prototype.show = function show (options, tooltipOptions, point) {
52
+ if (!this.chartService) {
53
+ return;
54
+ }
52
55
  options.format = tooltipOptions.format;
53
56
 
54
57
  var style = this.getStyle(tooltipOptions, point);
@@ -281,7 +281,7 @@ var ChartElement = (function (Class) {
281
281
  };
282
282
 
283
283
  ChartElement.prototype.toggleFocusHighlight = function toggleFocusHighlight (show) {
284
- var options = ((this.options || {}).accessibility || {}).highlight || {};
284
+ var options = (this.options || {}).focusHighlight || {};
285
285
  var focusHighlight = this._focusHighlight;
286
286
 
287
287
  if (!show && !focusHighlight) {
@@ -201,7 +201,7 @@ export var Link = (function (SankeyElement) {
201
201
 
202
202
  var offset = calculateControlPointsOffsetX(link, this.options.rtl);
203
203
 
204
- this._highlight = new drawing.Path({ stroke: this.options.focusHighlight, visible: false })
204
+ this._highlight = new drawing.Path({ stroke: this.options.focusHighlight.border, visible: false })
205
205
  .moveTo(x0, y0 + halfWidth)
206
206
  .lineTo(x0, y0 - halfWidth)
207
207
  .curveTo([xC + offset, y0 - halfWidth], [xC + offset, y1 - halfWidth], [x1, y1 - halfWidth])
@@ -52,7 +52,7 @@ export var Node = (function (SankeyElement) {
52
52
  }
53
53
 
54
54
  this._highlight = drawing.Path.fromRect(this.getRect(), {
55
- stroke: this.options.focusHighlight,
55
+ stroke: this.options.focusHighlight.border,
56
56
  visible: false
57
57
  });
58
58
 
@@ -633,7 +633,8 @@ export var Sankey = (function (Observable) {
633
633
  var disableKeyboardNavigation = sankeyOptions.disableKeyboardNavigation;
634
634
  var rtl = sankeyOptions.rtl;
635
635
  var autoLayout = !disableAutoLayout;
636
- var padding = disableKeyboardNavigation ? 0 : highlightOptions.width / 2;
636
+ var focusHighlightWidth = ((nodes.focusHighlight || {}).border || {}).width || 0;
637
+ var padding = disableKeyboardNavigation ? 0 : focusHighlightWidth / 2;
637
638
 
638
639
  var sankeyBox = new Box(0, 0, calcOptions.width, calcOptions.height);
639
640
  sankeyBox.unpad(padding);
@@ -984,7 +985,9 @@ setDefaultOptions(Sankey, {
984
985
  opacity: 1,
985
986
  align: 'stretch', // 'left', 'right', 'stretch'
986
987
  offset: { left: 0, top: 0 },
987
- focusHighlight: Object.assign({}, highlightOptions),
988
+ focusHighlight: {
989
+ border: Object.assign({}, highlightOptions)
990
+ },
988
991
  labels: {
989
992
  ariaTemplate: function (ref) {
990
993
  var node = ref.node;
@@ -1000,7 +1003,9 @@ setDefaultOptions(Sankey, {
1000
1003
  opacity: 0.8,
1001
1004
  inactiveOpacity: 0.2
1002
1005
  },
1003
- focusHighlight: Object.assign({}, highlightOptions),
1006
+ focusHighlight: {
1007
+ border: Object.assign({}, highlightOptions)
1008
+ },
1004
1009
  labels: {
1005
1010
  ariaTemplate: function (ref) {
1006
1011
  var link = ref.link;
@@ -201,7 +201,7 @@ class Bar extends ChartElement {
201
201
  }
202
202
 
203
203
  createFocusHighlight(style) {
204
- const borderWidth = this.options.accessibility.highlight.border.width;
204
+ const borderWidth = this.options.focusHighlight.border.width;
205
205
  const highlight = draw.Path.fromRect(this.box.pad(borderWidth / 2).toRect(), style);
206
206
 
207
207
  return alignPathToPixel(highlight);
@@ -58,7 +58,7 @@ class Bubble extends LinePoint {
58
58
  }
59
59
 
60
60
  createFocusHighlight(style) {
61
- const highlightOptions = this.options.accessibility.highlight;
61
+ const highlightOptions = this.options.focusHighlight;
62
62
  const markers = this.options.markers;
63
63
  const center = this.box.center();
64
64
  const radius = (markers.size + markers.border.width) / 2 + highlightOptions.border.width / 2;
@@ -2270,13 +2270,12 @@ setDefaultOptions(Chart, {
2270
2270
  legend: {
2271
2271
  visible: true,
2272
2272
  labels: {},
2273
- accessibility: {
2274
- highlight: {
2275
- border: {
2276
- opacity: 1,
2277
- color: BLACK,
2278
- width: 2
2279
- }
2273
+ accessibility: {},
2274
+ focusHighlight: {
2275
+ border: {
2276
+ opacity: 1,
2277
+ color: BLACK,
2278
+ width: 2
2280
2279
  }
2281
2280
  }
2282
2281
  },
@@ -2291,14 +2290,13 @@ setDefaultOptions(Chart, {
2291
2290
  negativeValues: {
2292
2291
  visible: false
2293
2292
  },
2294
- accessibility: {
2295
- highlight: {
2296
- border: {
2297
- opacity: 1,
2298
- width: 2
2299
- },
2300
- zIndex: 200
2301
- }
2293
+ accessibility: {},
2294
+ focusHighlight: {
2295
+ border: {
2296
+ opacity: 1,
2297
+ width: 2
2298
+ },
2299
+ zIndex: 200
2302
2300
  }
2303
2301
  },
2304
2302
  series: [],
@@ -107,7 +107,7 @@ class FunnelSegment extends ChartElement {
107
107
  }
108
108
 
109
109
  createFocusHighlight(style) {
110
- const borderWidth = this.options.accessibility.highlight.border.width;
110
+ const borderWidth = this.options.focusHighlight.border.width;
111
111
  const result = draw.Path.fromPoints(this.points, deepExtend({}, style, {
112
112
  stroke: {
113
113
  width: borderWidth * 2
@@ -204,7 +204,7 @@ class HeatmapPoint extends ChartElement {
204
204
 
205
205
  createFocusHighlight() {
206
206
  const markerOptions = this.options.markers;
207
- const highlightOptions = this.options.accessibility.highlight;
207
+ const highlightOptions = this.options.focusHighlight;
208
208
 
209
209
  const highlight = new ShapeElement({
210
210
  type: valueOrDefault(markerOptions.type, 'rect'),
@@ -108,7 +108,8 @@ class Legend extends ChartElement {
108
108
  area: Object.assign({}, {opacity: opacity},
109
109
  options.area),
110
110
  opacity: opacity,
111
- accessibility: options.accessibility
111
+ accessibility: options.accessibility,
112
+ focusHighlight: options.focusHighlight
112
113
  },
113
114
  options.item,
114
115
  legendItem,
@@ -254,7 +254,7 @@ class LinePoint extends ChartElement {
254
254
 
255
255
  createFocusHighlight() {
256
256
  const markerOptions = this.options.markers;
257
- const highlightOptions = this.options.accessibility.highlight;
257
+ const highlightOptions = this.options.focusHighlight;
258
258
  const size = markerOptions.size + (markerOptions.border.width || 0);
259
259
 
260
260
  const highlight = new ShapeElement({
@@ -247,7 +247,7 @@ class PieSegment extends ChartElement {
247
247
  }
248
248
 
249
249
  createFocusHighlight(style) {
250
- const borderWidth = this.options.accessibility.highlight.border.width;
250
+ const borderWidth = this.options.focusHighlight.border.width;
251
251
  const result = this.createSegment(this.sector, deepExtend({}, style, {
252
252
  stroke: {
253
253
  width: borderWidth * 2
@@ -44,6 +44,9 @@ class BaseTooltip extends Class {
44
44
  }
45
45
 
46
46
  show(options, tooltipOptions, point) {
47
+ if (!this.chartService) {
48
+ return;
49
+ }
47
50
  options.format = tooltipOptions.format;
48
51
 
49
52
  const style = this.getStyle(tooltipOptions, point);
@@ -272,7 +272,7 @@ class ChartElement extends Class {
272
272
  }
273
273
 
274
274
  toggleFocusHighlight(show) {
275
- const options = ((this.options || {}).accessibility || {}).highlight || {};
275
+ const options = (this.options || {}).focusHighlight || {};
276
276
  let focusHighlight = this._focusHighlight;
277
277
 
278
278
  if (!show && !focusHighlight) {
@@ -186,7 +186,7 @@ export class Link extends SankeyElement {
186
186
 
187
187
  const offset = calculateControlPointsOffsetX(link, this.options.rtl);
188
188
 
189
- this._highlight = new drawing.Path({ stroke: this.options.focusHighlight, visible: false })
189
+ this._highlight = new drawing.Path({ stroke: this.options.focusHighlight.border, visible: false })
190
190
  .moveTo(x0, y0 + halfWidth)
191
191
  .lineTo(x0, y0 - halfWidth)
192
192
  .curveTo([xC + offset, y0 - halfWidth], [xC + offset, y1 - halfWidth], [x1, y1 - halfWidth])
@@ -44,7 +44,7 @@ export class Node extends SankeyElement {
44
44
  }
45
45
 
46
46
  this._highlight = drawing.Path.fromRect(this.getRect(), {
47
- stroke: this.options.focusHighlight,
47
+ stroke: this.options.focusHighlight.border,
48
48
  visible: false
49
49
  });
50
50
 
@@ -594,7 +594,8 @@ export class Sankey extends Observable {
594
594
  calculateSankey(calcOptions, sankeyOptions) {
595
595
  const { title, legend, data, nodes, labels, nodeColors, disableAutoLayout, disableKeyboardNavigation, rtl } = sankeyOptions;
596
596
  const autoLayout = !disableAutoLayout;
597
- const padding = disableKeyboardNavigation ? 0 : highlightOptions.width / 2;
597
+ const focusHighlightWidth = ((nodes.focusHighlight || {}).border || {}).width || 0;
598
+ const padding = disableKeyboardNavigation ? 0 : focusHighlightWidth / 2;
598
599
 
599
600
  const sankeyBox = new Box(0, 0, calcOptions.width, calcOptions.height);
600
601
  sankeyBox.unpad(padding);
@@ -925,7 +926,9 @@ setDefaultOptions(Sankey, {
925
926
  opacity: 1,
926
927
  align: 'stretch', // 'left', 'right', 'stretch'
927
928
  offset: { left: 0, top: 0 },
928
- focusHighlight: Object.assign({}, highlightOptions),
929
+ focusHighlight: {
930
+ border: Object.assign({}, highlightOptions)
931
+ },
929
932
  labels: {
930
933
  ariaTemplate: ({ node }) => node.label.text
931
934
  }
@@ -937,7 +940,9 @@ setDefaultOptions(Sankey, {
937
940
  opacity: 0.8,
938
941
  inactiveOpacity: 0.2
939
942
  },
940
- focusHighlight: Object.assign({}, highlightOptions),
943
+ focusHighlight: {
944
+ border: Object.assign({}, highlightOptions)
945
+ },
941
946
  labels: {
942
947
  ariaTemplate: ({ link }) => `${link.source.label.text} to ${link.target.label.text}`
943
948
  }
@@ -0,0 +1,23 @@
1
+ import { Border } from './border.interface';
2
+
3
+ /**
4
+ * Represents the focus highlight border options.
5
+ */
6
+ export interface FocusHighlightBorder extends Border {
7
+ /**
8
+ * The opacity of the focus highlight border.
9
+ *
10
+ * @default 1
11
+ */
12
+ opacity?: number;
13
+ }
14
+
15
+ /**
16
+ * Represents the focus highlight options.
17
+ */
18
+ export interface FocusHighlight {
19
+ /**
20
+ * The border options of the focus highlight.
21
+ */
22
+ border?: FocusHighlightBorder;
23
+ }
@@ -3,4 +3,5 @@ export { DashType } from './field-types/dash-type';
3
3
  export { Margin } from './field-types/margin.interface';
4
4
  export { Padding } from './field-types/padding.interface';
5
5
  export { RenderMode } from './field-types/render-mode';
6
+ export { FocusHighlight, FocusHighlightBorder } from './field-types/focus-highlight.interface';
6
7
  export * from './field-types/series-pattern.interface';