@progress/kendo-angular-charts 15.5.0-develop.9 → 16.0.0-develop.1
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/charts.module.d.ts +2 -1
- package/common/has-observers.d.ts +9 -0
- package/esm2020/chart.component.mjs +1 -3
- package/esm2020/charts.module.mjs +4 -3
- package/esm2020/common/has-observers.mjs +10 -0
- package/esm2020/common/theme.service.mjs +6 -0
- package/esm2020/index.mjs +4 -0
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/sankey/api-types/index.mjs +5 -0
- package/esm2020/sankey/data-binding/create-sankey-data.mjs +45 -0
- package/esm2020/sankey/data-binding/flat-binding.directive.mjs +65 -0
- package/esm2020/sankey/data-binding/flat-binding.event.mjs +15 -0
- package/esm2020/sankey/events/index.mjs +8 -0
- package/esm2020/sankey/events/instance-event.service.mjs +22 -0
- package/esm2020/sankey/events/sankey-base-event.mjs +18 -0
- package/esm2020/sankey/events/sankey-link-event.mjs +17 -0
- package/esm2020/sankey/events/sankey-node-event.mjs +17 -0
- package/esm2020/sankey/labels.component.mjs +49 -0
- package/esm2020/sankey/legend.component.mjs +64 -0
- package/esm2020/sankey/links.component.mjs +37 -0
- package/esm2020/sankey/localization/custom-messages.component.mjs +42 -0
- package/esm2020/sankey/localization/localized-messages.directive.mjs +37 -0
- package/esm2020/sankey/localization/messages.mjs +23 -0
- package/esm2020/sankey/nodes.component.mjs +43 -0
- package/esm2020/sankey/title.component.mjs +59 -0
- package/esm2020/sankey/tooltip/link-tooltip-template-context.mjs +18 -0
- package/esm2020/sankey/tooltip/link-tooltip-template.directive.mjs +87 -0
- package/esm2020/sankey/tooltip/node-tooltip-template-context.mjs +18 -0
- package/esm2020/sankey/tooltip/node-tooltip-template.directive.mjs +64 -0
- package/esm2020/sankey/tooltip/square-symbol.directive.mjs +43 -0
- package/esm2020/sankey/tooltip/tooltip-popup.component.mjs +203 -0
- package/esm2020/sankey/tooltip/tooltip-template.service.mjs +16 -0
- package/esm2020/sankey/tooltip.component.mjs +52 -0
- package/esm2020/sankey.component.mjs +378 -0
- package/esm2020/sankey.directives.mjs +46 -0
- package/esm2020/sankey.module.mjs +63 -0
- package/fesm2015/progress-kendo-angular-charts.mjs +1353 -30
- package/fesm2020/progress-kendo-angular-charts.mjs +1347 -27
- package/index.d.ts +4 -0
- package/package.json +9 -8
- package/sankey/api-types/index.d.ts +21 -0
- package/sankey/data-binding/create-sankey-data.d.ts +9 -0
- package/sankey/data-binding/flat-binding.directive.d.ts +38 -0
- package/sankey/data-binding/flat-binding.event.d.ts +24 -0
- package/sankey/events/index.d.ts +8 -0
- package/sankey/events/instance-event.service.d.ts +14 -0
- package/sankey/events/sankey-base-event.d.ts +24 -0
- package/sankey/events/sankey-link-event.d.ts +20 -0
- package/sankey/events/sankey-node-event.d.ts +20 -0
- package/sankey/labels.component.d.ts +36 -0
- package/sankey/legend.component.d.ts +82 -0
- package/sankey/links.component.d.ts +22 -0
- package/sankey/localization/custom-messages.component.d.ts +18 -0
- package/sankey/localization/localized-messages.directive.d.ts +16 -0
- package/sankey/localization/messages.d.ts +17 -0
- package/sankey/nodes.component.d.ts +34 -0
- package/sankey/title.component.d.ts +70 -0
- package/sankey/tooltip/link-tooltip-template-context.d.ts +26 -0
- package/sankey/tooltip/link-tooltip-template.directive.d.ts +78 -0
- package/sankey/tooltip/node-tooltip-template-context.d.ts +26 -0
- package/sankey/tooltip/node-tooltip-template.directive.d.ts +55 -0
- package/sankey/tooltip/square-symbol.directive.d.ts +16 -0
- package/sankey/tooltip/tooltip-popup.component.d.ts +60 -0
- package/sankey/tooltip/tooltip-template.service.d.ts +15 -0
- package/sankey/tooltip.component.d.ts +49 -0
- package/sankey.component.d.ts +200 -0
- package/sankey.directives.d.ts +27 -0
- package/sankey.module.d.ts +51 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
6
|
+
import { ConfigurationService } from '../common/configuration.service';
|
|
7
|
+
import { SettingsComponent } from '../common/settings.component';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "../common/configuration.service";
|
|
10
|
+
/**
|
|
11
|
+
* The configuration options of the Sankey legend
|
|
12
|
+
* ([see example]({% slug legend_sankey %})).
|
|
13
|
+
*/
|
|
14
|
+
export class SankeyNodesComponent extends SettingsComponent {
|
|
15
|
+
constructor(configurationService) {
|
|
16
|
+
super('nodes', configurationService);
|
|
17
|
+
this.configurationService = configurationService;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
SankeyNodesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyNodesComponent, deps: [{ token: i1.ConfigurationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
21
|
+
SankeyNodesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SankeyNodesComponent, selector: "kendo-sankey-nodes", inputs: { colorType: "colorType", color: "color", opacity: "opacity", offset: "offset", padding: "padding", width: "width", align: "align" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyNodesComponent, decorators: [{
|
|
23
|
+
type: Component,
|
|
24
|
+
args: [{
|
|
25
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26
|
+
selector: 'kendo-sankey-nodes',
|
|
27
|
+
template: '',
|
|
28
|
+
}]
|
|
29
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigurationService }]; }, propDecorators: { colorType: [{
|
|
30
|
+
type: Input
|
|
31
|
+
}], color: [{
|
|
32
|
+
type: Input
|
|
33
|
+
}], opacity: [{
|
|
34
|
+
type: Input
|
|
35
|
+
}], offset: [{
|
|
36
|
+
type: Input
|
|
37
|
+
}], padding: [{
|
|
38
|
+
type: Input
|
|
39
|
+
}], width: [{
|
|
40
|
+
type: Input
|
|
41
|
+
}], align: [{
|
|
42
|
+
type: Input
|
|
43
|
+
}] } });
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
6
|
+
import { ConfigurationService } from '../common/configuration.service';
|
|
7
|
+
import { SettingsComponent } from '../common/settings.component';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "../common/configuration.service";
|
|
10
|
+
/**
|
|
11
|
+
* The configuration options of the Sankey title or text
|
|
12
|
+
* ([see example]({% slug title_sankey %})).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <kendo-sankey [data]="data">
|
|
17
|
+
* <kendo-sankey-title text="Title Text" [padding]="{bottom: 20}"></kendo-sankey-title>
|
|
18
|
+
* ...
|
|
19
|
+
* </kendo-sankey>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class SankeyTitleComponent extends SettingsComponent {
|
|
23
|
+
constructor(configurationService) {
|
|
24
|
+
super('title', configurationService);
|
|
25
|
+
this.configurationService = configurationService;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
SankeyTitleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyTitleComponent, deps: [{ token: i1.ConfigurationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
29
|
+
SankeyTitleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SankeyTitleComponent, selector: "kendo-sankey-title", inputs: { align: "align", background: "background", border: "border", color: "color", font: "font", margin: "margin", padding: "padding", position: "position", text: "text", description: "description", visible: "visible" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyTitleComponent, decorators: [{
|
|
31
|
+
type: Component,
|
|
32
|
+
args: [{
|
|
33
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
34
|
+
selector: 'kendo-sankey-title',
|
|
35
|
+
template: ''
|
|
36
|
+
}]
|
|
37
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigurationService }]; }, propDecorators: { align: [{
|
|
38
|
+
type: Input
|
|
39
|
+
}], background: [{
|
|
40
|
+
type: Input
|
|
41
|
+
}], border: [{
|
|
42
|
+
type: Input
|
|
43
|
+
}], color: [{
|
|
44
|
+
type: Input
|
|
45
|
+
}], font: [{
|
|
46
|
+
type: Input
|
|
47
|
+
}], margin: [{
|
|
48
|
+
type: Input
|
|
49
|
+
}], padding: [{
|
|
50
|
+
type: Input
|
|
51
|
+
}], position: [{
|
|
52
|
+
type: Input
|
|
53
|
+
}], text: [{
|
|
54
|
+
type: Input
|
|
55
|
+
}], description: [{
|
|
56
|
+
type: Input
|
|
57
|
+
}], visible: [{
|
|
58
|
+
type: Input
|
|
59
|
+
}] } });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* The context that is passed to the Sankey diagram Link tooltip template.
|
|
7
|
+
*/
|
|
8
|
+
export class SankeyLinkTooltipTemplateContext {
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
constructor(e) {
|
|
13
|
+
const dataItem = e.dataItem;
|
|
14
|
+
this.source = dataItem.source;
|
|
15
|
+
this.target = dataItem.target;
|
|
16
|
+
this.value = dataItem.value;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, TemplateRef, Optional } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* A directive that selects a [template](link:site.data.urls.angular['templatesyntax'])
|
|
9
|
+
* within the `<kendo-sankey-tooltip>` component for the
|
|
10
|
+
* [links tooltip](slug:tooltip_sankey#toc-specifying-a-template).
|
|
11
|
+
* The following context fields are frequently utilized:
|
|
12
|
+
* - `let-source="source"`—The link source data item..
|
|
13
|
+
* - `let-target="target"`—The link target data item.
|
|
14
|
+
* - `let-value="value"`—The link value.
|
|
15
|
+
* For the full list of available fields, refer to the [`SankeyLinkTooltipTemplateContext`](slug:api_charts_sankeylinktooltiptemplatecontext).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { Component } from '@angular/core';
|
|
20
|
+
*
|
|
21
|
+
* _@Component({
|
|
22
|
+
* selector: 'my-app',
|
|
23
|
+
* template: `
|
|
24
|
+
* <kendo-chart>
|
|
25
|
+
* <kendo-chart-tooltip>
|
|
26
|
+
* <ng-template kendoChartSeriesTooltipTemplate let-value="value">
|
|
27
|
+
* Value is {{value}}
|
|
28
|
+
* </ng-template>
|
|
29
|
+
* </kendo-chart-tooltip>
|
|
30
|
+
* <kendo-chart-series>
|
|
31
|
+
* <kendo-chart-series-item [data]="[1, 2, 3]">
|
|
32
|
+
* </kendo-chart-series-item>
|
|
33
|
+
* </kendo-chart-series>
|
|
34
|
+
* </kendo-chart>
|
|
35
|
+
* `
|
|
36
|
+
* })
|
|
37
|
+
* class AppComponent {
|
|
38
|
+
* }
|
|
39
|
+
*
|
|
40
|
+
* import { Component } from '@angular/core';
|
|
41
|
+
* import { SankeyData } from '@progress/kendo-angular-charts';
|
|
42
|
+
*
|
|
43
|
+
* _@Component({
|
|
44
|
+
* selector: 'my-app',
|
|
45
|
+
* template: `
|
|
46
|
+
* <kendo-sankey [data]="data">
|
|
47
|
+
* <kendo-sankey-tooltip [followPointer]="true">
|
|
48
|
+
* <ng-template kendoSankeyLinkTooltipTemplate let-source="source" let-target="target" let-value="value">
|
|
49
|
+
* {{ source.label?.text }} - {{ target.label?.text }}: {{ value }}
|
|
50
|
+
* </ng-template>
|
|
51
|
+
* </kendo-sankey-tooltip>
|
|
52
|
+
* </kendo-sankey>
|
|
53
|
+
* `,
|
|
54
|
+
* })
|
|
55
|
+
* export class AppComponent {
|
|
56
|
+
* public data: SankeyData = {
|
|
57
|
+
* nodes: [
|
|
58
|
+
* { id: 1, label: { text: 'Linux' } },
|
|
59
|
+
* { id: 0, label: { text: 'iOS'} },
|
|
60
|
+
* { id: 2, label: { text: 'Mobile' } },
|
|
61
|
+
* { id: 3, label: { text: 'Desktop' } },
|
|
62
|
+
* ],
|
|
63
|
+
* links: [
|
|
64
|
+
* { sourceId: 0, targetId: 2, value: 1 },
|
|
65
|
+
* { sourceId: 1, targetId: 2, value: 2 },
|
|
66
|
+
* { sourceId: 1, targetId: 3, value: 3 },
|
|
67
|
+
* ],
|
|
68
|
+
* };
|
|
69
|
+
* }
|
|
70
|
+
*
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export class SankeyLinkTooltipTemplateDirective {
|
|
74
|
+
constructor(templateRef) {
|
|
75
|
+
this.templateRef = templateRef;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
SankeyLinkTooltipTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyLinkTooltipTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
79
|
+
SankeyLinkTooltipTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SankeyLinkTooltipTemplateDirective, selector: "[kendoSankeyLinkTooltipTemplate]", ngImport: i0 });
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyLinkTooltipTemplateDirective, decorators: [{
|
|
81
|
+
type: Directive,
|
|
82
|
+
args: [{
|
|
83
|
+
selector: '[kendoSankeyLinkTooltipTemplate]'
|
|
84
|
+
}]
|
|
85
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
86
|
+
type: Optional
|
|
87
|
+
}] }]; } });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* The context that is passed to the Sankey diagram Node tooltip template.
|
|
7
|
+
*/
|
|
8
|
+
export class SankeyNodeTooltipTemplateContext {
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
constructor(e) {
|
|
13
|
+
const dataItem = e.dataItem;
|
|
14
|
+
this.label = dataItem.label;
|
|
15
|
+
this.color = dataItem.color;
|
|
16
|
+
this.value = e.nodeValue;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, TemplateRef, Optional } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* A directive that selects a [template](link:site.data.urls.angular['templatesyntax'])
|
|
9
|
+
* within the `<kendo-sankey-tooltip>` component for the
|
|
10
|
+
* [series tooltip](slug:tooltip_sankey#toc-specifying-a-template).
|
|
11
|
+
* The following context fields are frequently utilized:
|
|
12
|
+
* - `let-color="color"`—The node color.
|
|
13
|
+
* - `let-label="label"`—The node label data.
|
|
14
|
+
* - `let-value="value"`—The node value.
|
|
15
|
+
* For the full list of available fields, refer to the [`SankeyNodeTooltipTemplateContext`](slug:api_charts_sankeynodetooltiptemplatecontext).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { Component } from '@angular/core';
|
|
20
|
+
* import { SankeyData } from '@progress/kendo-angular-charts';
|
|
21
|
+
*
|
|
22
|
+
* _@Component({
|
|
23
|
+
* selector: 'my-app',
|
|
24
|
+
* template: `
|
|
25
|
+
* <kendo-sankey [data]="data">
|
|
26
|
+
* <ng-template kendoSankeyNodeTooltipTemplate let-color="color" let-label="label" let-value="value">
|
|
27
|
+
* {{ label.text }}: {{ value }}
|
|
28
|
+
* </ng-template>
|
|
29
|
+
* </kendo-sankey>
|
|
30
|
+
* `,
|
|
31
|
+
* })
|
|
32
|
+
* export class AppComponent {
|
|
33
|
+
* public data: SankeyData = {
|
|
34
|
+
* nodes: [
|
|
35
|
+
* { id: 1, label: { text: 'Linux' } },
|
|
36
|
+
* { id: 0, label: { text: 'iOS'} },
|
|
37
|
+
* { id: 2, label: { text: 'Mobile' } },
|
|
38
|
+
* { id: 3, label: { text: 'Desktop' } },
|
|
39
|
+
* ],
|
|
40
|
+
* links: [
|
|
41
|
+
* { sourceId: 0, targetId: 2, value: 1 },
|
|
42
|
+
* { sourceId: 1, targetId: 2, value: 2 },
|
|
43
|
+
* { sourceId: 1, targetId: 3, value: 3 },
|
|
44
|
+
* ],
|
|
45
|
+
* };
|
|
46
|
+
* }
|
|
47
|
+
*
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export class SankeyNodeTooltipTemplateDirective {
|
|
51
|
+
constructor(templateRef) {
|
|
52
|
+
this.templateRef = templateRef;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
SankeyNodeTooltipTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyNodeTooltipTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
56
|
+
SankeyNodeTooltipTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SankeyNodeTooltipTemplateDirective, selector: "[kendoSankeyNodeTooltipTemplate]", ngImport: i0 });
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyNodeTooltipTemplateDirective, decorators: [{
|
|
58
|
+
type: Directive,
|
|
59
|
+
args: [{
|
|
60
|
+
selector: '[kendoSankeyNodeTooltipTemplate]'
|
|
61
|
+
}]
|
|
62
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
63
|
+
type: Optional
|
|
64
|
+
}] }]; } });
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, HostBinding, Input } from "@angular/core";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export class SquareSymbol {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.size = 15;
|
|
13
|
+
this.display = 'inline-flex';
|
|
14
|
+
this.marginLeft = 3;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
SquareSymbol.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SquareSymbol, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
18
|
+
SquareSymbol.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: SquareSymbol, selector: "[squareSymbol]", inputs: { color: "color", size: "size" }, host: { properties: { "style.backgroundColor": "this.color", "style.width.px": "this.size", "style.height.px": "this.size", "style.display": "this.display", "style.marginLeft.px": "this.marginLeft" } }, ngImport: i0 });
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SquareSymbol, decorators: [{
|
|
20
|
+
type: Directive,
|
|
21
|
+
args: [{
|
|
22
|
+
selector: '[squareSymbol]'
|
|
23
|
+
}]
|
|
24
|
+
}], propDecorators: { color: [{
|
|
25
|
+
type: Input
|
|
26
|
+
}, {
|
|
27
|
+
type: HostBinding,
|
|
28
|
+
args: ['style.backgroundColor']
|
|
29
|
+
}], size: [{
|
|
30
|
+
type: Input
|
|
31
|
+
}, {
|
|
32
|
+
type: HostBinding,
|
|
33
|
+
args: ['style.width.px']
|
|
34
|
+
}, {
|
|
35
|
+
type: HostBinding,
|
|
36
|
+
args: ['style.height.px']
|
|
37
|
+
}], display: [{
|
|
38
|
+
type: HostBinding,
|
|
39
|
+
args: ['style.display']
|
|
40
|
+
}], marginLeft: [{
|
|
41
|
+
type: HostBinding,
|
|
42
|
+
args: ['style.marginLeft.px']
|
|
43
|
+
}] } });
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, ElementRef, Input, NgZone, TemplateRef, ViewChild } from '@angular/core';
|
|
6
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { POPUP_CONTAINER, PopupService } from '@progress/kendo-angular-popup';
|
|
8
|
+
import { BaseTooltip } from '../../chart/tooltip/base-tooltip';
|
|
9
|
+
import { bodyFactory } from '../../chart/tooltip/body-factory';
|
|
10
|
+
import { SankeyLinkTooltipTemplateContext } from './link-tooltip-template-context';
|
|
11
|
+
import { SankeyLinkTooltipTemplateDirective } from './link-tooltip-template.directive';
|
|
12
|
+
import { SankeyNodeTooltipTemplateContext } from './node-tooltip-template-context';
|
|
13
|
+
import { SankeyNodeTooltipTemplateDirective } from './node-tooltip-template.directive';
|
|
14
|
+
import { SankeyTooltipTemplateService } from './tooltip-template.service';
|
|
15
|
+
import { arrowRightIcon } from '@progress/kendo-svg-icons';
|
|
16
|
+
import { IntlService } from '@progress/kendo-angular-intl';
|
|
17
|
+
import * as i0 from "@angular/core";
|
|
18
|
+
import * as i1 from "@progress/kendo-angular-popup";
|
|
19
|
+
import * as i2 from "./tooltip-template.service";
|
|
20
|
+
import * as i3 from "@progress/kendo-angular-l10n";
|
|
21
|
+
import * as i4 from "@progress/kendo-angular-intl";
|
|
22
|
+
import * as i5 from "@progress/kendo-angular-icons";
|
|
23
|
+
import * as i6 from "@angular/common";
|
|
24
|
+
import * as i7 from "./node-tooltip-template.directive";
|
|
25
|
+
import * as i8 from "./square-symbol.directive";
|
|
26
|
+
import * as i9 from "./link-tooltip-template.directive";
|
|
27
|
+
const DEFAULT_OFFSET = 12;
|
|
28
|
+
/**
|
|
29
|
+
* @hidden
|
|
30
|
+
*/
|
|
31
|
+
export class SankeyTooltipPopupComponent extends BaseTooltip {
|
|
32
|
+
constructor(element, popupService, templateService, localizationService, intlService, ngZone) {
|
|
33
|
+
super(popupService, localizationService);
|
|
34
|
+
this.element = element;
|
|
35
|
+
this.popupService = popupService;
|
|
36
|
+
this.templateService = templateService;
|
|
37
|
+
this.localizationService = localizationService;
|
|
38
|
+
this.intlService = intlService;
|
|
39
|
+
this.ngZone = ngZone;
|
|
40
|
+
this.animate = false;
|
|
41
|
+
this.wrapperClass = 'k-chart-tooltip-wrapper';
|
|
42
|
+
this.arrowRightIcon = arrowRightIcon;
|
|
43
|
+
// TODO: Move to themes
|
|
44
|
+
this.textStyle = { margin: '0 3px' };
|
|
45
|
+
this.tooltipStyle = { display: 'flex', alignItems: 'center' };
|
|
46
|
+
}
|
|
47
|
+
onInit() {
|
|
48
|
+
this.popupRef.popupElement.className += ` ${this.wrapperClass}`;
|
|
49
|
+
}
|
|
50
|
+
show(e) {
|
|
51
|
+
this.isNode = e.targetType === 'node';
|
|
52
|
+
this.isLink = e.targetType === 'link';
|
|
53
|
+
this.nodeTooltipTemplateRef = this.templateService.nodeTemplate || this.defaultNodeTooltipTemplate.templateRef;
|
|
54
|
+
this.nodeTooltipContext = new SankeyNodeTooltipTemplateContext(e);
|
|
55
|
+
this.linkTooltipTemplateRef = this.templateService.linkTemplate || this.defaultLinkTooltipTemplate.templateRef;
|
|
56
|
+
this.linkTooltipContext = new SankeyLinkTooltipTemplateContext(e);
|
|
57
|
+
super.show({
|
|
58
|
+
style: {
|
|
59
|
+
position: 'static' // Override k-tooltip positioning
|
|
60
|
+
},
|
|
61
|
+
anchor: {
|
|
62
|
+
align: e.tooltipData.popupAlign,
|
|
63
|
+
point: this.tooltipAnchor(e),
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
tooltipAnchor(e) {
|
|
68
|
+
const element = this.element.nativeElement;
|
|
69
|
+
const size = { width: element.offsetWidth, height: element.offsetHeight };
|
|
70
|
+
const anchor = { ...e.tooltipData.popupOffset };
|
|
71
|
+
const popupAlign = e.tooltipData.popupAlign;
|
|
72
|
+
const offset = this.offset || DEFAULT_OFFSET;
|
|
73
|
+
anchor.left += (popupAlign.horizontal === 'left') ? offset : (-1 * offset);
|
|
74
|
+
if (popupAlign.horizontal === 'right') {
|
|
75
|
+
anchor.left -= size.width;
|
|
76
|
+
}
|
|
77
|
+
if (popupAlign.vertical === 'bottom') {
|
|
78
|
+
anchor.top -= size.height + offset;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
anchor.top += offset;
|
|
82
|
+
}
|
|
83
|
+
return anchor;
|
|
84
|
+
}
|
|
85
|
+
formatUnits(value) {
|
|
86
|
+
return this.intlService.format(this.tooltipUnitFormat, value ?? 0);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
SankeyTooltipPopupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyTooltipPopupComponent, deps: [{ token: i0.ElementRef }, { token: i1.PopupService }, { token: i2.SankeyTooltipTemplateService }, { token: i3.LocalizationService }, { token: i4.IntlService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
90
|
+
SankeyTooltipPopupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SankeyTooltipPopupComponent, selector: "kendo-sankey-tooltip-popup", inputs: { animate: "animate", popupSettings: "popupSettings", wrapperClass: "wrapperClass", tooltipUnitFormat: "tooltipUnitFormat", offset: "offset" }, providers: [
|
|
91
|
+
PopupService,
|
|
92
|
+
{
|
|
93
|
+
provide: POPUP_CONTAINER,
|
|
94
|
+
useFactory: bodyFactory,
|
|
95
|
+
},
|
|
96
|
+
], viewQueries: [{ propertyName: "defaultNodeTooltipTemplate", first: true, predicate: SankeyNodeTooltipTemplateDirective, descendants: true }, { propertyName: "defaultLinkTooltipTemplate", first: true, predicate: SankeyLinkTooltipTemplateDirective, descendants: true }, { propertyName: "templateRef", first: true, predicate: ["content"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
97
|
+
<ng-template #content>
|
|
98
|
+
<div class="k-tooltip k-sankey-tooltip k-chart-tooltip k-chart-shared-tooltip" [ngStyle]="style">
|
|
99
|
+
<div class="k-tooltip-content">
|
|
100
|
+
<ng-template
|
|
101
|
+
[ngTemplateOutlet]="nodeTooltipTemplateRef"
|
|
102
|
+
*ngIf="isNode"
|
|
103
|
+
[ngTemplateOutletContext]="nodeTooltipContext"
|
|
104
|
+
>
|
|
105
|
+
</ng-template>
|
|
106
|
+
<ng-template
|
|
107
|
+
[ngTemplateOutlet]="linkTooltipTemplateRef"
|
|
108
|
+
*ngIf="isLink"
|
|
109
|
+
[ngTemplateOutletContext]="linkTooltipContext"
|
|
110
|
+
>
|
|
111
|
+
</ng-template>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</ng-template>
|
|
115
|
+
|
|
116
|
+
<ng-template kendoSankeyNodeTooltipTemplate let-color="color" let-label="label" let-value="value">
|
|
117
|
+
<div [ngStyle]="tooltipStyle">
|
|
118
|
+
<div squareSymbol [color]="color"></div>
|
|
119
|
+
<span [ngStyle]="textStyle">{{ label.text }}</span>
|
|
120
|
+
<span [ngStyle]="textStyle">{{ formatUnits(value) }}</span>
|
|
121
|
+
</div>
|
|
122
|
+
</ng-template>
|
|
123
|
+
|
|
124
|
+
<ng-template kendoSankeyLinkTooltipTemplate let-source="source" let-target="target" let-value="value">
|
|
125
|
+
<div [ngStyle]="tooltipStyle">
|
|
126
|
+
<div squareSymbol [color]="source.color"></div>
|
|
127
|
+
<span [ngStyle]="textStyle">{{ source.label?.text }}</span>
|
|
128
|
+
<kendo-icon-wrapper name="arrow-right" [svgIcon]="arrowRightIcon"></kendo-icon-wrapper>
|
|
129
|
+
<span [ngStyle]="textStyle">{{ target.label?.text }}</span>
|
|
130
|
+
<span [ngStyle]="textStyle">{{ formatUnits(value) }}</span>
|
|
131
|
+
</div>
|
|
132
|
+
</ng-template>
|
|
133
|
+
`, isInline: true, components: [{ type: i5.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i7.SankeyNodeTooltipTemplateDirective, selector: "[kendoSankeyNodeTooltipTemplate]" }, { type: i8.SquareSymbol, selector: "[squareSymbol]", inputs: ["color", "size"] }, { type: i9.SankeyLinkTooltipTemplateDirective, selector: "[kendoSankeyLinkTooltipTemplate]" }] });
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyTooltipPopupComponent, decorators: [{
|
|
135
|
+
type: Component,
|
|
136
|
+
args: [{
|
|
137
|
+
providers: [
|
|
138
|
+
PopupService,
|
|
139
|
+
{
|
|
140
|
+
provide: POPUP_CONTAINER,
|
|
141
|
+
useFactory: bodyFactory,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
selector: 'kendo-sankey-tooltip-popup',
|
|
145
|
+
template: `
|
|
146
|
+
<ng-template #content>
|
|
147
|
+
<div class="k-tooltip k-sankey-tooltip k-chart-tooltip k-chart-shared-tooltip" [ngStyle]="style">
|
|
148
|
+
<div class="k-tooltip-content">
|
|
149
|
+
<ng-template
|
|
150
|
+
[ngTemplateOutlet]="nodeTooltipTemplateRef"
|
|
151
|
+
*ngIf="isNode"
|
|
152
|
+
[ngTemplateOutletContext]="nodeTooltipContext"
|
|
153
|
+
>
|
|
154
|
+
</ng-template>
|
|
155
|
+
<ng-template
|
|
156
|
+
[ngTemplateOutlet]="linkTooltipTemplateRef"
|
|
157
|
+
*ngIf="isLink"
|
|
158
|
+
[ngTemplateOutletContext]="linkTooltipContext"
|
|
159
|
+
>
|
|
160
|
+
</ng-template>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</ng-template>
|
|
164
|
+
|
|
165
|
+
<ng-template kendoSankeyNodeTooltipTemplate let-color="color" let-label="label" let-value="value">
|
|
166
|
+
<div [ngStyle]="tooltipStyle">
|
|
167
|
+
<div squareSymbol [color]="color"></div>
|
|
168
|
+
<span [ngStyle]="textStyle">{{ label.text }}</span>
|
|
169
|
+
<span [ngStyle]="textStyle">{{ formatUnits(value) }}</span>
|
|
170
|
+
</div>
|
|
171
|
+
</ng-template>
|
|
172
|
+
|
|
173
|
+
<ng-template kendoSankeyLinkTooltipTemplate let-source="source" let-target="target" let-value="value">
|
|
174
|
+
<div [ngStyle]="tooltipStyle">
|
|
175
|
+
<div squareSymbol [color]="source.color"></div>
|
|
176
|
+
<span [ngStyle]="textStyle">{{ source.label?.text }}</span>
|
|
177
|
+
<kendo-icon-wrapper name="arrow-right" [svgIcon]="arrowRightIcon"></kendo-icon-wrapper>
|
|
178
|
+
<span [ngStyle]="textStyle">{{ target.label?.text }}</span>
|
|
179
|
+
<span [ngStyle]="textStyle">{{ formatUnits(value) }}</span>
|
|
180
|
+
</div>
|
|
181
|
+
</ng-template>
|
|
182
|
+
`,
|
|
183
|
+
}]
|
|
184
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.PopupService }, { type: i2.SankeyTooltipTemplateService }, { type: i3.LocalizationService }, { type: i4.IntlService }, { type: i0.NgZone }]; }, propDecorators: { defaultNodeTooltipTemplate: [{
|
|
185
|
+
type: ViewChild,
|
|
186
|
+
args: [SankeyNodeTooltipTemplateDirective, { static: false }]
|
|
187
|
+
}], defaultLinkTooltipTemplate: [{
|
|
188
|
+
type: ViewChild,
|
|
189
|
+
args: [SankeyLinkTooltipTemplateDirective, { static: false }]
|
|
190
|
+
}], templateRef: [{
|
|
191
|
+
type: ViewChild,
|
|
192
|
+
args: ['content', { static: true }]
|
|
193
|
+
}], animate: [{
|
|
194
|
+
type: Input
|
|
195
|
+
}], popupSettings: [{
|
|
196
|
+
type: Input
|
|
197
|
+
}], wrapperClass: [{
|
|
198
|
+
type: Input
|
|
199
|
+
}], tooltipUnitFormat: [{
|
|
200
|
+
type: Input
|
|
201
|
+
}], offset: [{
|
|
202
|
+
type: Input
|
|
203
|
+
}] } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Injectable } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export class SankeyTooltipTemplateService {
|
|
11
|
+
}
|
|
12
|
+
SankeyTooltipTemplateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyTooltipTemplateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13
|
+
SankeyTooltipTemplateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyTooltipTemplateService });
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyTooltipTemplateService, decorators: [{
|
|
15
|
+
type: Injectable
|
|
16
|
+
}] });
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, ContentChild, Input } from '@angular/core';
|
|
6
|
+
import { ConfigurationService } from '../common/configuration.service';
|
|
7
|
+
import { SettingsComponent } from '../common/settings.component';
|
|
8
|
+
import { SankeyLinkTooltipTemplateDirective } from './tooltip/link-tooltip-template.directive';
|
|
9
|
+
import { SankeyNodeTooltipTemplateDirective } from './tooltip/node-tooltip-template.directive';
|
|
10
|
+
import { SankeyTooltipTemplateService } from './tooltip/tooltip-template.service';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "../common/configuration.service";
|
|
13
|
+
import * as i2 from "./tooltip/tooltip-template.service";
|
|
14
|
+
/**
|
|
15
|
+
* The configuration options of the Sankey tooltip
|
|
16
|
+
* ([see example]({% slug tooltip_sankey %})).
|
|
17
|
+
*/
|
|
18
|
+
export class SankeyTooltipComponent extends SettingsComponent {
|
|
19
|
+
constructor(configurationService, templateService) {
|
|
20
|
+
super('tooltip', configurationService);
|
|
21
|
+
this.configurationService = configurationService;
|
|
22
|
+
this.templateService = templateService;
|
|
23
|
+
this.markAsVisible();
|
|
24
|
+
}
|
|
25
|
+
ngAfterContentChecked() {
|
|
26
|
+
this.templateService.linkTemplate = this.linkTooltipTemplate?.templateRef;
|
|
27
|
+
this.templateService.nodeTemplate = this.nodeTooltipTemplate?.templateRef;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
SankeyTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyTooltipComponent, deps: [{ token: i1.ConfigurationService }, { token: i2.SankeyTooltipTemplateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
+
SankeyTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SankeyTooltipComponent, selector: "kendo-sankey-tooltip", inputs: { followPointer: "followPointer", delay: "delay", offset: "offset", visible: "visible" }, queries: [{ propertyName: "linkTooltipTemplate", first: true, predicate: SankeyLinkTooltipTemplateDirective, descendants: true }, { propertyName: "nodeTooltipTemplate", first: true, predicate: SankeyNodeTooltipTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SankeyTooltipComponent, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{
|
|
35
|
+
selector: 'kendo-sankey-tooltip',
|
|
36
|
+
template: '',
|
|
37
|
+
}]
|
|
38
|
+
}], ctorParameters: function () { return [{ type: i1.ConfigurationService }, { type: i2.SankeyTooltipTemplateService }]; }, propDecorators: { followPointer: [{
|
|
39
|
+
type: Input
|
|
40
|
+
}], delay: [{
|
|
41
|
+
type: Input
|
|
42
|
+
}], offset: [{
|
|
43
|
+
type: Input
|
|
44
|
+
}], visible: [{
|
|
45
|
+
type: Input
|
|
46
|
+
}], linkTooltipTemplate: [{
|
|
47
|
+
type: ContentChild,
|
|
48
|
+
args: [SankeyLinkTooltipTemplateDirective, { static: false }]
|
|
49
|
+
}], nodeTooltipTemplate: [{
|
|
50
|
+
type: ContentChild,
|
|
51
|
+
args: [SankeyNodeTooltipTemplateDirective, { static: false }]
|
|
52
|
+
}] } });
|