@progress/kendo-charts 2.3.0-dev.202404070723 → 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.
- package/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/sankey/node.js +3 -3
- package/dist/es/sankey/sankey.js +7 -7
- package/dist/es2015/sankey/node.js +3 -3
- package/dist/es2015/sankey/sankey.js +7 -7
- package/dist/npm/main.js +11 -11
- package/dist/npm/sankey.d.ts +4 -4
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +1 -1
package/dist/es/sankey/node.js
CHANGED
|
@@ -38,12 +38,12 @@ export var Node = (function (SankeyElement) {
|
|
|
38
38
|
return Node;
|
|
39
39
|
}(SankeyElement));
|
|
40
40
|
|
|
41
|
-
export var nodeColor = function (node,
|
|
41
|
+
export var nodeColor = function (node, nodeColors, index) { return node.color || nodeColors[index % nodeColors.length]; };
|
|
42
42
|
|
|
43
|
-
export var resolveNodeOptions = function (node, options,
|
|
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,
|
|
46
|
+
{ color: nodeColor(node, nodeColors, index) },
|
|
47
47
|
nodeOptions,
|
|
48
48
|
{ node: node },
|
|
49
49
|
{
|
package/dist/es/sankey/sankey.js
CHANGED
|
@@ -179,7 +179,7 @@ export var Sankey = (function (Observable) {
|
|
|
179
179
|
Sankey.prototype._mousemove = function _mousemove (ev) {
|
|
180
180
|
var this$1 = this;
|
|
181
181
|
|
|
182
|
-
var ref = this.options.
|
|
182
|
+
var ref = this.options.tooltip;
|
|
183
183
|
var followPointer = ref.followPointer;
|
|
184
184
|
var delay = ref.delay;
|
|
185
185
|
var element = ev.element;
|
|
@@ -333,7 +333,7 @@ export var Sankey = (function (Observable) {
|
|
|
333
333
|
var data = sankeyOptions.data;
|
|
334
334
|
var nodes = sankeyOptions.nodes;
|
|
335
335
|
var labels = sankeyOptions.labels;
|
|
336
|
-
var
|
|
336
|
+
var nodeColors = sankeyOptions.nodeColors;
|
|
337
337
|
var disableAutoLayout = sankeyOptions.disableAutoLayout;
|
|
338
338
|
var autoLayout = !disableAutoLayout;
|
|
339
339
|
|
|
@@ -378,7 +378,7 @@ export var Sankey = (function (Observable) {
|
|
|
378
378
|
var box = new Box();
|
|
379
379
|
|
|
380
380
|
calculatedNodes.forEach(function (nodeEl, i) {
|
|
381
|
-
var nodeOps = resolveNodeOptions(nodeEl, nodes,
|
|
381
|
+
var nodeOps = resolveNodeOptions(nodeEl, nodes, nodeColors, i);
|
|
382
382
|
var nodeInstance = new Node(nodeOps);
|
|
383
383
|
box.wrap(rectToBox(nodeInstance.exportVisual().rawBBox()));
|
|
384
384
|
|
|
@@ -460,7 +460,7 @@ export var Sankey = (function (Observable) {
|
|
|
460
460
|
var labelOptions = sankeyOptions.labels;
|
|
461
461
|
var nodesOptions = sankeyOptions.nodes;
|
|
462
462
|
var linkOptions = sankeyOptions.links;
|
|
463
|
-
var
|
|
463
|
+
var nodeColors = sankeyOptions.nodeColors;
|
|
464
464
|
var title = sankeyOptions.title;
|
|
465
465
|
var legend = sankeyOptions.legend;
|
|
466
466
|
var ref = sankeyContext.size;
|
|
@@ -489,7 +489,7 @@ export var Sankey = (function (Observable) {
|
|
|
489
489
|
sankeyContext.nodesVisuals = visualNodes;
|
|
490
490
|
|
|
491
491
|
nodes.forEach(function (node, i) {
|
|
492
|
-
var nodeOps = resolveNodeOptions(node, nodesOptions,
|
|
492
|
+
var nodeOps = resolveNodeOptions(node, nodesOptions, nodeColors, i);
|
|
493
493
|
|
|
494
494
|
var nodeInstance = new Node(nodeOps);
|
|
495
495
|
var nodeVisual = nodeInstance.exportVisual();
|
|
@@ -546,7 +546,7 @@ export var Sankey = (function (Observable) {
|
|
|
546
546
|
});
|
|
547
547
|
|
|
548
548
|
if (legendBox) {
|
|
549
|
-
var legendElement = new Legend(Object.assign({}, legend, {drawingRect: legendBox, nodes: nodes, colors:
|
|
549
|
+
var legendElement = new Legend(Object.assign({}, legend, {drawingRect: legendBox, nodes: nodes, colors: nodeColors}));
|
|
550
550
|
var legendVisual = legendElement.exportVisual();
|
|
551
551
|
visual.append(legendVisual);
|
|
552
552
|
}
|
|
@@ -612,7 +612,7 @@ setDefaultOptions(Sankey, {
|
|
|
612
612
|
inactiveOpacity: 0.2
|
|
613
613
|
}
|
|
614
614
|
},
|
|
615
|
-
|
|
615
|
+
tooltip: {
|
|
616
616
|
followPointer: false,
|
|
617
617
|
delay: 1000
|
|
618
618
|
}
|
|
@@ -28,12 +28,12 @@ export class Node extends SankeyElement {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export const nodeColor = (node,
|
|
31
|
+
export const nodeColor = (node, nodeColors, index) => node.color || nodeColors[index % nodeColors.length];
|
|
32
32
|
|
|
33
|
-
export const resolveNodeOptions = (node, options,
|
|
33
|
+
export const resolveNodeOptions = (node, options, nodeColors, index) => {
|
|
34
34
|
const nodeOptions = deepExtend({}, options, options.node);
|
|
35
35
|
return deepExtend({},
|
|
36
|
-
{ color: nodeColor(node,
|
|
36
|
+
{ color: nodeColor(node, nodeColors, index) },
|
|
37
37
|
nodeOptions,
|
|
38
38
|
{ node },
|
|
39
39
|
{
|
|
@@ -165,7 +165,7 @@ export class Sankey extends Observable {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
_mousemove(ev) {
|
|
168
|
-
const { followPointer, delay } = this.options.
|
|
168
|
+
const { followPointer, delay } = this.options.tooltip;
|
|
169
169
|
const element = ev.element;
|
|
170
170
|
const tooltipElType = element.type;
|
|
171
171
|
|
|
@@ -306,7 +306,7 @@ export class Sankey extends Observable {
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
calculateSankey(calcOptions, sankeyOptions) {
|
|
309
|
-
const { title, legend, data, nodes, labels,
|
|
309
|
+
const { title, legend, data, nodes, labels, nodeColors, disableAutoLayout } = sankeyOptions;
|
|
310
310
|
const autoLayout = !disableAutoLayout;
|
|
311
311
|
|
|
312
312
|
const sankeyBox = new Box(0, 0, calcOptions.width, calcOptions.height);
|
|
@@ -350,7 +350,7 @@ export class Sankey extends Observable {
|
|
|
350
350
|
const box = new Box();
|
|
351
351
|
|
|
352
352
|
calculatedNodes.forEach((nodeEl, i) => {
|
|
353
|
-
const nodeOps = resolveNodeOptions(nodeEl, nodes,
|
|
353
|
+
const nodeOps = resolveNodeOptions(nodeEl, nodes, nodeColors, i);
|
|
354
354
|
const nodeInstance = new Node(nodeOps);
|
|
355
355
|
box.wrap(rectToBox(nodeInstance.exportVisual().rawBBox()));
|
|
356
356
|
|
|
@@ -428,7 +428,7 @@ export class Sankey extends Observable {
|
|
|
428
428
|
const sankeyOptions = options || this.options;
|
|
429
429
|
const sankeyContext = context || this;
|
|
430
430
|
|
|
431
|
-
const { data, labels: labelOptions, nodes: nodesOptions, links: linkOptions,
|
|
431
|
+
const { data, labels: labelOptions, nodes: nodesOptions, links: linkOptions, nodeColors, title, legend } = sankeyOptions;
|
|
432
432
|
const { width, height } = sankeyContext.size;
|
|
433
433
|
|
|
434
434
|
const calcOptions = Object.assign({}, data, {width, height, nodesOptions, title, legend});
|
|
@@ -449,7 +449,7 @@ export class Sankey extends Observable {
|
|
|
449
449
|
sankeyContext.nodesVisuals = visualNodes;
|
|
450
450
|
|
|
451
451
|
nodes.forEach((node, i) => {
|
|
452
|
-
const nodeOps = resolveNodeOptions(node, nodesOptions,
|
|
452
|
+
const nodeOps = resolveNodeOptions(node, nodesOptions, nodeColors, i);
|
|
453
453
|
|
|
454
454
|
const nodeInstance = new Node(nodeOps);
|
|
455
455
|
const nodeVisual = nodeInstance.exportVisual();
|
|
@@ -505,7 +505,7 @@ export class Sankey extends Observable {
|
|
|
505
505
|
});
|
|
506
506
|
|
|
507
507
|
if (legendBox) {
|
|
508
|
-
const legendElement = new Legend(Object.assign({}, legend, {drawingRect: legendBox, nodes, colors:
|
|
508
|
+
const legendElement = new Legend(Object.assign({}, legend, {drawingRect: legendBox, nodes, colors: nodeColors}));
|
|
509
509
|
const legendVisual = legendElement.exportVisual();
|
|
510
510
|
visual.append(legendVisual);
|
|
511
511
|
}
|
|
@@ -569,7 +569,7 @@ setDefaultOptions(Sankey, {
|
|
|
569
569
|
inactiveOpacity: 0.2
|
|
570
570
|
}
|
|
571
571
|
},
|
|
572
|
-
|
|
572
|
+
tooltip: {
|
|
573
573
|
followPointer: false,
|
|
574
574
|
delay: 1000
|
|
575
575
|
}
|