@progress/kendo-angular-charts
Version:
Kendo UI Charts for Angular - A comprehensive package for creating beautiful and interactive data visualization. Every chart type, stock charts, and sparklines are included.
216 lines (215 loc) • 9.26 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2024 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, Renderer2, SimpleChange } from '@angular/core';
import { LocalizationService } from '@progress/kendo-angular-l10n';
import { Group, ImageExportOptions, SVGExportOptions } from '@progress/kendo-drawing';
import { Subscription } from 'rxjs';
import { ConfigurationService } from './common/configuration.service';
import { ThemeService } from './common/theme.service';
import { InstanceEventService, SankeyLinkEvent, SankeyNodeEvent } from './sankey/events';
import { Sankey, SankeyEvent, SankeyTooltipEvent } from '@progress/kendo-charts';
import { SankeyExportVisualOptions, SankeyLabelDefaults, SankeyLinkDefaults, SankeyNodeDefaults, SankeyTooltip } from './sankey/api-types';
import { PopupSettings } from './chart/tooltip/popup-settings.interface';
import { SankeyData, SankeyLegend, SankeyTitle } from './sankey/api-types';
import { SankeyTooltipPopupComponent } from './sankey/tooltip/tooltip-popup.component';
import { IntlService } from '@progress/kendo-angular-intl';
import * as i0 from "@angular/core";
/**
* The Sankey diagram component.
*
* @example
* ```ts
* import { Component } from '@angular/core';
*
* _@Component({
* selector: 'my-app',
* template: `
* <kendo-sankey [data]="data">
* </kendo-sankey>
* `,
* })
* export class AppComponent {
* public data: SankeyData = {
* nodes: [
* { id: 1, label: { text: 'Linux' } },
* { id: 0, label: { text: 'iOS'} },
* { id: 2, label: { text: 'Mobile' } },
* { id: 3, label: { text: 'Desktop' } },
* ],
* links: [
* { sourceId: 0, targetId: 2, value: 1 },
* { sourceId: 1, targetId: 2, value: 2 },
* { sourceId: 1, targetId: 3, value: 3 },
* ],
* };
* }
* ```
*/
export declare class SankeyComponent implements AfterViewInit, OnChanges, OnDestroy {
protected element: ElementRef;
configurationService: ConfigurationService;
themeService: ThemeService;
protected localizationService: LocalizationService;
protected instanceEventService: InstanceEventService;
protected ngZone: NgZone;
protected changeDetector: ChangeDetectorRef;
protected renderer: Renderer2;
protected intlService: IntlService;
/**
* The data of the Sankey component containing the `links` and `nodes`.
*/
data: SankeyData;
/**
* The default configuration for links.
* These settings will be applied to all links unless overridden by individual data items.
*/
links?: SankeyLinkDefaults;
/**
* The default configuration for nodes.
* These settings will be applied to all nodes unless overridden by individual data items.
*/
nodes?: SankeyNodeDefaults;
/**
* The default configuration for labels.
* These settings will be applied to all labels unless overridden by individual data items.
*/
labels?: SankeyLabelDefaults;
/**
* The title configuration of the Sankey component.
*/
title?: SankeyTitle;
/**
* The legend configuration of the Sankey component.
*/
legend?: SankeyLegend;
/**
* The configuration of the Sankey tooltip.
*/
tooltip?: SankeyTooltip;
/**
* If set to `true`, the Sankey component will not perform automatic layout.
*/
disableAutoLayout?: boolean;
/**
* If set to `false`, the Sankey keyboard navigation will be disabled.
* By default, navigation is enabled.
*
* @default true
*/
navigable?: boolean;
/**
* The settings for the tooltip popup.
*/
popupSettings: PopupSettings;
/**
* Fires when the mouse pointer enters a node. Similar to the `mouseenter` event.
*/
nodeEnter: EventEmitter<SankeyNodeEvent>;
/**
* Fires when the mouse pointer leaves a node. Similar to the `mouseleave` event.
*/
nodeLeave: EventEmitter<SankeyNodeEvent>;
/**
* Fires when a node is clicked.
*/
nodeClick: EventEmitter<SankeyNodeEvent>;
/**
* Fires when the mouse pointer enters a link. Similar to the `mouseenter` event,
*/
linkEnter: EventEmitter<SankeyLinkEvent>;
/**
* Fires when the mouse pointer leaves a link. Similar to the `mouseleave` event.
*/
linkLeave: EventEmitter<SankeyLinkEvent>;
/**
* Fires when a link is clicked.
*/
linkClick: EventEmitter<SankeyLinkEvent>;
tooltipInstance: SankeyTooltipPopupComponent;
instanceElement: ElementRef;
/**
* @hidden
*/
showLicenseWatermark: boolean;
instance: Sankey;
protected options: any;
protected theme: any;
protected optionsChange: Subscription;
protected redrawTimeout: any;
protected destroyed: boolean;
protected subscriptions: Subscription;
protected rtl: boolean;
constructor(element: ElementRef, configurationService: ConfigurationService, themeService: ThemeService, localizationService: LocalizationService, instanceEventService: InstanceEventService, ngZone: NgZone, changeDetector: ChangeDetectorRef, renderer: Renderer2, intlService: IntlService);
ngAfterViewInit(): void;
ngOnChanges(changes: {
[propertyName: string]: SimpleChange;
}): void;
/**
* Updates the component fields with the specified values and refreshes the widget.
*
* Use this method when the configuration values cannot be set through the template.
*
* @example
* ```ts-no-run
* sankey.notifyChanges({ title: { text: 'New Title' } });
* ```
*
* @param changes An object containing the updated input fields.
*/
notifyChanges(changes: any): void;
ngOnDestroy(): void;
/**
* @hidden
*/
messageFor(key: string): string;
protected createInstance(element: any): void;
/**
* Exports the Sankey diagram as an image. The export operation is asynchronous and returns a promise.
*
* @param {ImageExportOptions} options - The parameters for the exported image.
* @returns {Promise<string>} - A promise that will be resolved with a PNG image encoded as a Data URI.
*/
exportImage(options?: SankeyExportVisualOptions & ImageExportOptions): Promise<string>;
/**
* Exports the Sankey diagram as an SVG document. The export operation is asynchronous and returns a promise.
*
* @param options - The parameters for the exported file.
* @returns - A promise that will be resolved with an SVG document that is encoded as a Data URI.
*/
exportSVG(options?: SankeyExportVisualOptions & SVGExportOptions): Promise<string>;
/**
* Exports the visual of the Sankey component to a drawing group.
*
* @param options - The parameters for the export operation.
* @returns - The root Group of the scene.
*/
exportVisual(options?: SankeyExportVisualOptions): Group;
protected init(): void;
/**
* Reloads the Sankey appearance settings from the current [Kendo UI Theme]({% slug themesandstyles %}).
*
* Call this method after loading a different theme stylesheet.
*/
reloadTheme(): void;
protected onShowTooltip(e: SankeyTooltipEvent): void;
protected onHideTooltip(): void;
protected trigger(name: string, e: SankeyEvent): boolean;
protected requiresHandlers(names: string[]): boolean;
protected refresh(): void;
protected updateOptions(): void;
protected get canRender(): boolean;
protected get instanceOptions(): any;
protected activeEmitter(name: string): any;
protected refreshWait(): void;
protected loadTheme(chartTheme: any): any;
protected run(callback: any, inZone?: boolean, detectChanges?: boolean): void;
protected detectChanges(): void;
protected intlChange(): void;
protected rtlChange(): void;
protected setDirection(): void;
protected get isRTL(): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<SankeyComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<SankeyComponent, "kendo-sankey", ["kendoSankey"], { "data": { "alias": "data"; "required": false; }; "links": { "alias": "links"; "required": false; }; "nodes": { "alias": "nodes"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "title": { "alias": "title"; "required": false; }; "legend": { "alias": "legend"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "disableAutoLayout": { "alias": "disableAutoLayout"; "required": false; }; "navigable": { "alias": "navigable"; "required": false; }; "popupSettings": { "alias": "popupSettings"; "required": false; }; }, { "nodeEnter": "nodeEnter"; "nodeLeave": "nodeLeave"; "nodeClick": "nodeClick"; "linkEnter": "linkEnter"; "linkLeave": "linkLeave"; "linkClick": "linkClick"; }, never, never, true, never>;
}