@progress/kendo-charts 2.3.0-dev.202404030928 → 2.3.0-dev.202404081747

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.
@@ -38,12 +38,12 @@ export var Node = (function (SankeyElement) {
38
38
  return Node;
39
39
  }(SankeyElement));
40
40
 
41
- export var nodeColor = function (node, nodesColors, index) { return node.color || nodesColors[index % nodesColors.length]; };
41
+ export var nodeColor = function (node, nodeColors, index) { return node.color || nodeColors[index % nodeColors.length]; };
42
42
 
43
- export var resolveNodeOptions = function (node, options, nodesColors, index) {
43
+ export var resolveNodeOptions = function (node, options, nodeColors, index) {
44
44
  var nodeOptions = deepExtend({}, options, options.node);
45
45
  return deepExtend({},
46
- { color: nodeColor(node, nodesColors, index) },
46
+ { color: nodeColor(node, nodeColors, index) },
47
47
  nodeOptions,
48
48
  { node: node },
49
49
  {
@@ -24,9 +24,8 @@ export var Sankey = (function (Observable) {
24
24
 
25
25
  if (options && options.data) {
26
26
  this._redraw();
27
+ this._initResizeObserver();
27
28
  }
28
-
29
- this._initResizeObserver();
30
29
  }
31
30
 
32
31
  if ( Observable ) Sankey.__proto__ = Observable;
@@ -74,7 +73,7 @@ export var Sankey = (function (Observable) {
74
73
  var width = ref.width;
75
74
  var height = ref.height;
76
75
  if (entry.target !== this$1.element ||
77
- (this$1.size.width === width && this$1.size.height === height)) {
76
+ (this$1.size && this$1.size.width === width && this$1.size.height === height)) {
78
77
  return;
79
78
  }
80
79
  this$1.size = { width: width, height: height };
@@ -180,7 +179,7 @@ export var Sankey = (function (Observable) {
180
179
  Sankey.prototype._mousemove = function _mousemove (ev) {
181
180
  var this$1 = this;
182
181
 
183
- var ref = this.options.tooltips;
182
+ var ref = this.options.tooltip;
184
183
  var followPointer = ref.followPointer;
185
184
  var delay = ref.delay;
186
185
  var element = ev.element;
@@ -334,7 +333,7 @@ export var Sankey = (function (Observable) {
334
333
  var data = sankeyOptions.data;
335
334
  var nodes = sankeyOptions.nodes;
336
335
  var labels = sankeyOptions.labels;
337
- var nodesColors = sankeyOptions.nodesColors;
336
+ var nodeColors = sankeyOptions.nodeColors;
338
337
  var disableAutoLayout = sankeyOptions.disableAutoLayout;
339
338
  var autoLayout = !disableAutoLayout;
340
339
 
@@ -379,7 +378,7 @@ export var Sankey = (function (Observable) {
379
378
  var box = new Box();
380
379
 
381
380
  calculatedNodes.forEach(function (nodeEl, i) {
382
- var nodeOps = resolveNodeOptions(nodeEl, nodes, nodesColors, i);
381
+ var nodeOps = resolveNodeOptions(nodeEl, nodes, nodeColors, i);
383
382
  var nodeInstance = new Node(nodeOps);
384
383
  box.wrap(rectToBox(nodeInstance.exportVisual().rawBBox()));
385
384
 
@@ -461,7 +460,7 @@ export var Sankey = (function (Observable) {
461
460
  var labelOptions = sankeyOptions.labels;
462
461
  var nodesOptions = sankeyOptions.nodes;
463
462
  var linkOptions = sankeyOptions.links;
464
- var nodesColors = sankeyOptions.nodesColors;
463
+ var nodeColors = sankeyOptions.nodeColors;
465
464
  var title = sankeyOptions.title;
466
465
  var legend = sankeyOptions.legend;
467
466
  var ref = sankeyContext.size;
@@ -490,7 +489,7 @@ export var Sankey = (function (Observable) {
490
489
  sankeyContext.nodesVisuals = visualNodes;
491
490
 
492
491
  nodes.forEach(function (node, i) {
493
- var nodeOps = resolveNodeOptions(node, nodesOptions, nodesColors, i);
492
+ var nodeOps = resolveNodeOptions(node, nodesOptions, nodeColors, i);
494
493
 
495
494
  var nodeInstance = new Node(nodeOps);
496
495
  var nodeVisual = nodeInstance.exportVisual();
@@ -547,7 +546,7 @@ export var Sankey = (function (Observable) {
547
546
  });
548
547
 
549
548
  if (legendBox) {
550
- var legendElement = new Legend(Object.assign({}, legend, {drawingRect: legendBox, nodes: nodes, colors: nodesColors}));
549
+ var legendElement = new Legend(Object.assign({}, legend, {drawingRect: legendBox, nodes: nodes, colors: nodeColors}));
551
550
  var legendVisual = legendElement.exportVisual();
552
551
  visual.append(legendVisual);
553
552
  }
@@ -613,7 +612,7 @@ setDefaultOptions(Sankey, {
613
612
  inactiveOpacity: 0.2
614
613
  }
615
614
  },
616
- tooltips: {
615
+ tooltip: {
617
616
  followPointer: false,
618
617
  delay: 1000
619
618
  }
@@ -28,12 +28,12 @@ export class Node extends SankeyElement {
28
28
  }
29
29
  }
30
30
 
31
- export const nodeColor = (node, nodesColors, index) => node.color || nodesColors[index % nodesColors.length];
31
+ export const nodeColor = (node, nodeColors, index) => node.color || nodeColors[index % nodeColors.length];
32
32
 
33
- export const resolveNodeOptions = (node, options, nodesColors, index) => {
33
+ export const resolveNodeOptions = (node, options, nodeColors, index) => {
34
34
  const nodeOptions = deepExtend({}, options, options.node);
35
35
  return deepExtend({},
36
- { color: nodeColor(node, nodesColors, index) },
36
+ { color: nodeColor(node, nodeColors, index) },
37
37
  nodeOptions,
38
38
  { node },
39
39
  {
@@ -24,9 +24,8 @@ export class Sankey extends Observable {
24
24
 
25
25
  if (options && options.data) {
26
26
  this._redraw();
27
+ this._initResizeObserver();
27
28
  }
28
-
29
- this._initResizeObserver();
30
29
  }
31
30
 
32
31
  destroy() {
@@ -65,7 +64,7 @@ export class Sankey extends Observable {
65
64
  entries.forEach(entry => {
66
65
  const { width, height } = entry.contentRect;
67
66
  if (entry.target !== this.element ||
68
- (this.size.width === width && this.size.height === height)) {
67
+ (this.size && this.size.width === width && this.size.height === height)) {
69
68
  return;
70
69
  }
71
70
  this.size = { width, height };
@@ -166,7 +165,7 @@ export class Sankey extends Observable {
166
165
  }
167
166
 
168
167
  _mousemove(ev) {
169
- const { followPointer, delay } = this.options.tooltips;
168
+ const { followPointer, delay } = this.options.tooltip;
170
169
  const element = ev.element;
171
170
  const tooltipElType = element.type;
172
171
 
@@ -307,7 +306,7 @@ export class Sankey extends Observable {
307
306
  }
308
307
 
309
308
  calculateSankey(calcOptions, sankeyOptions) {
310
- const { title, legend, data, nodes, labels, nodesColors, disableAutoLayout } = sankeyOptions;
309
+ const { title, legend, data, nodes, labels, nodeColors, disableAutoLayout } = sankeyOptions;
311
310
  const autoLayout = !disableAutoLayout;
312
311
 
313
312
  const sankeyBox = new Box(0, 0, calcOptions.width, calcOptions.height);
@@ -351,7 +350,7 @@ export class Sankey extends Observable {
351
350
  const box = new Box();
352
351
 
353
352
  calculatedNodes.forEach((nodeEl, i) => {
354
- const nodeOps = resolveNodeOptions(nodeEl, nodes, nodesColors, i);
353
+ const nodeOps = resolveNodeOptions(nodeEl, nodes, nodeColors, i);
355
354
  const nodeInstance = new Node(nodeOps);
356
355
  box.wrap(rectToBox(nodeInstance.exportVisual().rawBBox()));
357
356
 
@@ -429,7 +428,7 @@ export class Sankey extends Observable {
429
428
  const sankeyOptions = options || this.options;
430
429
  const sankeyContext = context || this;
431
430
 
432
- const { data, labels: labelOptions, nodes: nodesOptions, links: linkOptions, nodesColors, title, legend } = sankeyOptions;
431
+ const { data, labels: labelOptions, nodes: nodesOptions, links: linkOptions, nodeColors, title, legend } = sankeyOptions;
433
432
  const { width, height } = sankeyContext.size;
434
433
 
435
434
  const calcOptions = Object.assign({}, data, {width, height, nodesOptions, title, legend});
@@ -450,7 +449,7 @@ export class Sankey extends Observable {
450
449
  sankeyContext.nodesVisuals = visualNodes;
451
450
 
452
451
  nodes.forEach((node, i) => {
453
- const nodeOps = resolveNodeOptions(node, nodesOptions, nodesColors, i);
452
+ const nodeOps = resolveNodeOptions(node, nodesOptions, nodeColors, i);
454
453
 
455
454
  const nodeInstance = new Node(nodeOps);
456
455
  const nodeVisual = nodeInstance.exportVisual();
@@ -506,7 +505,7 @@ export class Sankey extends Observable {
506
505
  });
507
506
 
508
507
  if (legendBox) {
509
- const legendElement = new Legend(Object.assign({}, legend, {drawingRect: legendBox, nodes, colors: nodesColors}));
508
+ const legendElement = new Legend(Object.assign({}, legend, {drawingRect: legendBox, nodes, colors: nodeColors}));
510
509
  const legendVisual = legendElement.exportVisual();
511
510
  visual.append(legendVisual);
512
511
  }
@@ -570,7 +569,7 @@ setDefaultOptions(Sankey, {
570
569
  inactiveOpacity: 0.2
571
570
  }
572
571
  },
573
- tooltips: {
572
+ tooltip: {
574
573
  followPointer: false,
575
574
  delay: 1000
576
575
  }