import type { DataItem } from "../../core/render/Component"; import type { Color } from "../../core/util/Color"; import type { FlowLink } from "./FlowLink"; import type { FlowNodes, IFlowNodesDataItem } from "./FlowNodes"; import type { ListTemplate } from "../../core/util/List"; import type { Bullet } from "../../core/render/Bullet"; import type * as d3sankey from "d3-sankey"; import { Series, ISeriesSettings, ISeriesDataItem, ISeriesPrivate, ISeriesEvents } from "../../core/render/Series"; import { Container } from "../../core/render/Container"; export interface IFlowDataItem extends ISeriesDataItem { /** * Link value. */ value: number; /** * @ignore */ valueWorking: number; /** * The link element drawn for this data item. */ link: FlowLink; /** * Link's color. */ fill: Color; /** * @ignore */ d3SankeyLink: d3sankey.SankeyLink; /** * ID of the target node. */ targetId: string; /** * ID of the source node. */ sourceId: string; /** * Data item of the source node. */ source: DataItem; /** * Data item of the target node. */ target: DataItem; } export interface IFlowSettings extends ISeriesSettings { /** * Field in data that holds the source node's ID. */ sourceIdField?: string; /** * Field in data that holds the target node's ID. */ targetIdField?: string; /** * Thickness of the node bars, in pixels. Not used by [[ArcDiagram]]. * * @default 10 */ nodeWidth?: number; /** * Gap between adjacent nodes, in pixels: `10` in a [[Sankey]], `5` in an * [[ArcDiagram]]. A [[Chord]] uses `padAngle` instead. */ nodePadding?: number; /** * Smallest size a link is drawn at, as a fraction of the sum of all link * values. For example, `0.01` draws every link at least as thick as one * holding 1% of the total, so small links and their nodes stay visible. * * @default 0 * @since 5.1.5 */ minSize?: number; /** * Size a hidden link keeps in the layout, as a fraction of its value. Links * hide when their node is toggled off with a click (`toggleKey: "disabled"` * on nodes); a small size keeps that node visible so it can be clicked back * on. * * @default 0.05 * @see {@link https://www.amcharts.com/docs/v5/charts/flow-charts/#Node_toggling} for more info * @since 5.4.1 */ hiddenSize?: number; /** * Smallest value a hidden link shrinks to, whatever `hiddenSize` gives. * * @default 0 * @see {@link https://www.amcharts.com/docs/v5/charts/flow-charts/#Node_toggling} for more info * @since 5.4.1 */ minHiddenValue?: number; } export interface IFlowPrivate extends ISeriesPrivate { valueSum?: number; valueLow?: number; valueHigh?: number; } export interface IFlowEvents extends ISeriesEvents { } /** * Base class for the flow series: [[Sankey]], [[Chord]] and [[ArcDiagram]]. * * @see {@link https://www.amcharts.com/docs/v5/charts/flow-charts/} for more info */ export declare abstract class Flow extends Series { static className: string; static classNames: Array; _settings: IFlowSettings; _privateSettings: IFlowPrivate; _dataItemSettings: IFlowDataItem; _events: IFlowEvents; /** * @ignore */ readonly nodes: FlowNodes; /** * Container that holds the link elements. */ readonly linksContainer: Container; /** * @ignore */ abstract readonly links: ListTemplate; protected _nodesData: d3sankey.SankeyNodeMinimal<{}, {}>[]; protected _linksData: { source: d3sankey.SankeyNodeMinimal<{}, {}>; target: d3sankey.SankeyNodeMinimal<{}, {}>; value: number; }[]; protected _index: number; protected _nodesDataSet: boolean; protected _linksByIndex: { [index: string]: any; }; protected _afterNew(): void; /** * Bullets sit in the series' own coordinates - a link bullet is placed from * the link's geometry - so the container stays where `_afterNew` put it. * A chart moving it into its own would leave every bullet adrift from the * link or node it marks by however far the series sits from the chart origin. * * @ignore */ _placeBulletsContainer(): void; /** * @ignore */ abstract makeLink(dataItem: DataItem): FlowLink; protected processDataItem(dataItem: DataItem): void; protected _onDataClear(): void; _prepareChildren(): void; _updateLinkColor(dataItem: DataItem): void; /** * @ignore */ disposeDataItem(dataItem: DataItem): void; /** * Hides a link: fades its element out and shrinks its value to * `hiddenSize` (or `minHiddenValue`), so its nodes keep some size. * * @param dataItem Link data item * @param duration Animation duration in milliseconds * @return Promise */ hideDataItem(dataItem: DataItem, duration?: number): Promise; /** * Shows a hidden link, growing it back to its value. * * @param dataItem Link data item * @param duration Animation duration in milliseconds * @return Promise */ showDataItem(dataItem: DataItem, duration?: number): Promise; _positionBullet(bullet: Bullet): void; protected _getBulletLocation(bullet: Bullet): number; } //# sourceMappingURL=Flow.d.ts.map