apexsankey 1.6.0 β†’ 1.7.0

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.
Files changed (44) hide show
  1. package/.github/workflows/publish.yml +8 -5
  2. package/README.md +39 -29
  3. package/apexsankey.d.ts +472 -0
  4. package/package.json +4 -4
  5. package/CHANGELOG.md +0 -14
  6. package/LICENSE +0 -80
  7. package/index.d.ts +0 -4
  8. package/lib/a11y/SankeyA11y.d.ts +0 -51
  9. package/lib/graph/Graph.d.ts +0 -35
  10. package/lib/layout/edgeOrdering/index.d.ts +0 -1
  11. package/lib/layout/edgeOrdering/linkDirection.d.ts +0 -1
  12. package/lib/layout/edgeOrdering/linkTypeOrder.d.ts +0 -1
  13. package/lib/layout/edgeOrdering/orderEdges.d.ts +0 -14
  14. package/lib/layout/edgePositioning/index.d.ts +0 -1
  15. package/lib/layout/edgePositioning/linkLayout.d.ts +0 -4
  16. package/lib/layout/edgePositioning/utils.d.ts +0 -10
  17. package/lib/layout/layout.d.ts +0 -71
  18. package/lib/layout/nodeOrdering/addDummyNodes.d.ts +0 -4
  19. package/lib/layout/nodeOrdering/countCrossings.d.ts +0 -31
  20. package/lib/layout/nodeOrdering/index.d.ts +0 -2
  21. package/lib/layout/nodeOrdering/initialOrdering.d.ts +0 -3
  22. package/lib/layout/nodeOrdering/ordering.d.ts +0 -12
  23. package/lib/layout/nodeOrdering/swapNodes.d.ts +0 -3
  24. package/lib/layout/nodeOrdering/weightedMedian.d.ts +0 -9
  25. package/lib/layout/nodePositioning/horizontal.d.ts +0 -4
  26. package/lib/layout/nodePositioning/index.d.ts +0 -2
  27. package/lib/layout/nodePositioning/justified.d.ts +0 -63
  28. package/lib/layout/rankAssignment/assignRanks.d.ts +0 -6
  29. package/lib/layout/rankAssignment/groupedGraph.d.ts +0 -10
  30. package/lib/layout/rankAssignment/index.d.ts +0 -1
  31. package/lib/layout/rankAssignment/initialRank.d.ts +0 -6
  32. package/lib/layout/rankAssignment/makeAcyclic.d.ts +0 -12
  33. package/lib/layout/types.d.ts +0 -99
  34. package/lib/layout/utils.d.ts +0 -13
  35. package/lib/models/ColorPalette.d.ts +0 -4
  36. package/lib/models/Edge.d.ts +0 -17
  37. package/lib/models/Graph.d.ts +0 -43
  38. package/lib/models/Node.d.ts +0 -16
  39. package/lib/models/Options.d.ts +0 -94
  40. package/lib/models/Paper.d.ts +0 -19
  41. package/lib/models/PathHighlighter.d.ts +0 -28
  42. package/lib/models/SankeyAnimation.d.ts +0 -12
  43. package/lib/sankey.d.ts +0 -13
  44. package/lib/utils/cssVars.d.ts +0 -29
package/LICENSE DELETED
@@ -1,80 +0,0 @@
1
- ## πŸ“„ License Options for ApexCharts
2
-
3
- ApexCharts is offered under a **dual-license model** to support individuals, startups, and commercial products of all sizes.
4
-
5
- ---
6
-
7
- ### πŸ”“ Community License (Free)
8
-
9
- For individuals, non-profits, educators, and small businesses with **less than $2 million USD in annual revenue**.
10
-
11
- βœ… What’s allowed:
12
-
13
- - Personal, educational, or non-profit use
14
- - Commercial use by small orgs (< $2M annual revenue)
15
- - Modifications and redistribution (with attribution)
16
-
17
- 🚫 Not allowed:
18
-
19
- - Use by companies or entities over $2M/year revenue
20
- - Use in competing charting products
21
- - Sublicensing under different terms
22
-
23
- ➑ By using ApexCharts under this license, you confirm that **you qualify as a Small Organization**.
24
-
25
- ---
26
-
27
- ### πŸ’Ό Commercial License (Paid)
28
-
29
- Required if **you or your affiliated organization earns $2 million USD or more per year**.
30
-
31
- βœ… What's included:
32
-
33
- - Use in internal tools and commercial applications
34
- - Modifications and app-level distribution
35
- - 12-month subscription with updates & support
36
-
37
- 🚫 Not allowed:
38
-
39
- - Redistribution in toolkits, SDKs, or platforms
40
- - Use by unlicensed developers
41
- - Competing charting products
42
-
43
- ---
44
-
45
- ### πŸ”„ OEM / Redistribution License (Paid)
46
-
47
- Required if you are **embedding ApexCharts into a product or platform used by other people**, such as:
48
-
49
- - No-code dashboards
50
- - Developer platforms
51
- - Embedded BI tools
52
- - White-labeled apps or SDKs
53
-
54
- βœ… What's included:
55
-
56
- - Redistribution rights for 1 application or product
57
- - 12-month subscription with updates & support
58
-
59
- βœ… OEM **not required** if your app simply renders static charts and users **cannot** configure or interact with them.
60
-
61
- ---
62
-
63
- ### ⚠️ License Acceptance
64
-
65
- By installing ApexCharts (e.g., via `npm install apexcharts`), you are agreeing to the applicable license based on your usage:
66
-
67
- - Community License (if under $2M revenue)
68
- - Commercial License (if over $2M revenue)
69
- - OEM License (if redistributing to third-party users)
70
-
71
- ---
72
-
73
- ### πŸ›  Need a License or Have Questions?
74
-
75
- πŸ“§ Contact us at [sales@apexcharts.com](mailto:sales@apexcharts.com)
76
- πŸ“š Read full license agreements here: [https://apexcharts.com/license](https://apexcharts.com/license)
77
-
78
- ---
79
-
80
- Thank you for supporting ApexCharts! Your licensing helps keep it free and open for individuals and small teams.
package/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { ApexSankey } from './lib/sankey';
2
-
3
- export { ApexSankey as default };
4
- export { ApexSankey };
@@ -1,51 +0,0 @@
1
- import { PathHighlighter } from '../models/PathHighlighter';
2
- import { SankeyGraph } from '../layout/types';
3
-
4
- /** ARIA / accessibility options passed from SankeyOptions.a11y */
5
- export interface A11yOptions {
6
- enabled?: boolean;
7
- diagramLabel?: string;
8
- description?: string;
9
- }
10
- /**
11
- * Injects WCAG 2.1 AA accessibility attributes into a rendered Sankey diagram:
12
- * - ARIA roles and labels on the SVG root, node groups, and edge paths
13
- * - `<title>` and optional `<desc>` elements inside the SVG
14
- * - Keyboard navigation (Enter / Space to activate, Escape to dismiss)
15
- * - Visible focus ring via JS (robust across browsers)
16
- * - `forced-colors` CSS class on the SVG root when the system is in High Contrast Mode
17
- */
18
- export declare class SankeyA11y {
19
- private readonly svgEl;
20
- private readonly graph;
21
- private readonly options;
22
- private readonly tooltipId?;
23
- private readonly pathHighlighter?;
24
- private nodeGroups;
25
- private edgePaths;
26
- /** Maps node id β†’ its outgoing edge paths, in DOM order */
27
- private nodeOutEdges;
28
- /** Maps edge element β†’ source node id (for Escape-to-return) */
29
- private edgeSourceNode;
30
- private mediaQuery;
31
- private forcedColorsHandler;
32
- private isKeyboardUser;
33
- constructor(svgEl: SVGSVGElement, graph: SankeyGraph, options?: A11yOptions, tooltipId?: string | undefined, pathHighlighter?: PathHighlighter | null | undefined);
34
- /** Apply all accessibility enhancements. Safe to call on every render. */
35
- apply(): void;
36
- /**
37
- * Remove media-query listener. Should be called before the diagram is
38
- * destroyed or before a new SankeyA11y is created for the same SVG.
39
- */
40
- destroy(): void;
41
- private injectAriaAttributes;
42
- private setupKeyboardNavigation;
43
- private hideTooltip;
44
- /**
45
- * Applies a visible focus ring by overriding the rect's stroke attributes.
46
- * More reliable than CSS outline on SVG elements across all browsers.
47
- */
48
- private applyFocusRing;
49
- private restoreFocusRing;
50
- private setupHighContrastMode;
51
- }
@@ -1,35 +0,0 @@
1
- export interface GraphOptions {
2
- directed?: boolean;
3
- multigraph?: boolean;
4
- }
5
- export interface EdgeObj {
6
- v: string;
7
- w: string;
8
- name?: string;
9
- }
10
- export declare class Graph {
11
- private _nodes;
12
- private _edges;
13
- private _graphLabel;
14
- private _out;
15
- private _in;
16
- private _isMultigraph;
17
- constructor(opts?: GraphOptions);
18
- graph(): unknown;
19
- setGraph(label: unknown): this;
20
- setNode(id: string, label?: unknown): this;
21
- node(id: string): unknown;
22
- hasNode(id: string): boolean;
23
- nodes(): string[];
24
- removeNode(id: string): this;
25
- sources(): string[];
26
- successors(v: string): string[];
27
- setEdge(vOrEdge: string | EdgeObj, wOrLabel?: unknown, label?: unknown, name?: string): this;
28
- edge(eOrV: EdgeObj | string, w?: string, name?: string): unknown;
29
- hasEdge(v: string, w: string, name?: string): boolean;
30
- edges(): EdgeObj[];
31
- removeEdge(e: EdgeObj): this;
32
- outEdges(v: string): EdgeObj[];
33
- inEdges(v: string): EdgeObj[];
34
- nodeEdges(a: string, b: string): EdgeObj[];
35
- }
@@ -1 +0,0 @@
1
- export { orderEdges } from './orderEdges';
@@ -1 +0,0 @@
1
- export declare function linkDirection(G: any, link: any): number;
@@ -1 +0,0 @@
1
- export declare function linkTypeOrder(G: any, u: any): any[];
@@ -1,14 +0,0 @@
1
- import { SankeyGraph } from '../types';
2
-
3
- /**
4
- * Assign incoming and outgoing edge lists to each node.
5
- *
6
- * The actual sorting of edges for smooth flow is handled in linkLayout.ts
7
- * where edges are sorted by connected node y-position before endpoint assignment.
8
- *
9
- * @param {Graph} G - The graph. Nodes must have `x` and `y` attributes.
10
- *
11
- */
12
- export declare function orderEdges(G: SankeyGraph, { alignLinkTypes: _alignLinkTypes }?: {
13
- alignLinkTypes?: boolean | undefined;
14
- }): void;
@@ -1 +0,0 @@
1
- export { linkLayout } from './linkLayout';
@@ -1,4 +0,0 @@
1
- import { SankeyOptions } from '../../models/Options';
2
- import { EdgeLabel, SankeyGraph } from '../types';
3
-
4
- export declare function linkLayout(options: Partial<SankeyOptions>): (G: SankeyGraph) => EdgeLabel[];
@@ -1,10 +0,0 @@
1
- import { EdgeLabel, SankeyGraph } from '../types';
2
-
3
- export declare function findFirst(links: EdgeLabel[], p: (link: EdgeLabel) => boolean): number | null;
4
- /**
5
- * Adjust radii of curvature to avoid overlaps, as much as possible.
6
- * @param links - the list of links, ordered from outside to inside of bend
7
- * @param rr - "r0" or "r1", the side to work on
8
- */
9
- export declare function sweepCurvatureInwards(links: EdgeLabel[], rr: 'r0' | 'r1'): void;
10
- export declare function addLinkEndpoints(G: SankeyGraph): void;
@@ -1,71 +0,0 @@
1
- import { EdgeLabel, RankSet, SankeyGraph } from './types';
2
- import { LayoutGraph, LayoutNode } from './nodePositioning/justified';
3
- import { SankeyOptions } from '../models/Options';
4
-
5
- /** Data passed to the layout function for controlling graph layout */
6
- interface LayoutData {
7
- order?: string[][][] | string[][];
8
- rankSets?: RankSet[];
9
- alignLinkTypes?: boolean;
10
- }
11
- /** Input edge data shape (from user-provided graph data) */
12
- interface InputEdge {
13
- source: string;
14
- target: string;
15
- type: string;
16
- }
17
- /** Input node data shape (from user-provided graph data) */
18
- interface InputNode {
19
- id: string;
20
- direction?: string;
21
- }
22
- /**
23
- * Sankey layout
24
- * @constructor sankey
25
- */
26
- export declare function sankey(options: Partial<SankeyOptions>): {
27
- (linksIn?: InputEdge[], nodesIn?: InputNode[], data?: LayoutData): SankeyGraph;
28
- nodes(): LayoutNode[];
29
- links(): EdgeLabel[];
30
- order(): string[][] | string[][][] | null;
31
- /**
32
- * Set size of layout.
33
- * @method size
34
- * @param size {[width, height]} - size
35
- * @returns {sankeyLayout|Number[]}
36
- */
37
- size(x?: number[]): number[] | {
38
- (G: LayoutGraph, order: string[][][], edgeGap?: number): LayoutNode[];
39
- scaleToFit(G: LayoutGraph, order: string[][][], edgeGap?: number): void;
40
- size(x?: number[] | undefined): number[] | any;
41
- separation(x?: number | ((a: string, b: string, G: LayoutGraph) => number) | undefined): ((a: string, b: string, G: LayoutGraph) => number) | any;
42
- whitespace(x?: number | undefined): number | any;
43
- scale(x?: number | undefined): number | any | null;
44
- } | any;
45
- separation(x?: number): ((a: string, b: string, G: LayoutGraph) => number) | {
46
- (G: LayoutGraph, order: string[][][], edgeGap?: number): LayoutNode[];
47
- scaleToFit(G: LayoutGraph, order: string[][][], edgeGap?: number): void;
48
- size(x?: number[] | undefined): number[] | any;
49
- separation(x?: number | ((a: string, b: string, G: LayoutGraph) => number) | undefined): ((a: string, b: string, G: LayoutGraph) => number) | any;
50
- whitespace(x?: number | undefined): number | any;
51
- scale(x?: number | undefined): number | any | null;
52
- } | any;
53
- whitespace(x?: number): number | {
54
- (G: LayoutGraph, order: string[][][], edgeGap?: number): LayoutNode[];
55
- scaleToFit(G: LayoutGraph, order: string[][][], edgeGap?: number): void;
56
- size(x?: number[] | undefined): number[] | any;
57
- separation(x?: number | ((a: string, b: string, G: LayoutGraph) => number) | undefined): ((a: string, b: string, G: LayoutGraph) => number) | any;
58
- whitespace(x?: number | undefined): number | any;
59
- scale(x?: number | undefined): number | any | null;
60
- } | any;
61
- edgeValue(_x?: unknown): any;
62
- scale(x?: number): number | {
63
- (G: LayoutGraph, order: string[][][], edgeGap?: number): LayoutNode[];
64
- scaleToFit(G: LayoutGraph, order: string[][][], edgeGap?: number): void;
65
- size(x?: number[] | undefined): number[] | any;
66
- separation(x?: number | ((a: string, b: string, G: LayoutGraph) => number) | undefined): ((a: string, b: string, G: LayoutGraph) => number) | any;
67
- whitespace(x?: number | undefined): number | any;
68
- scale(x?: number | undefined): number | any | null;
69
- } | any | null;
70
- };
71
- export {};
@@ -1,4 +0,0 @@
1
- import { SankeyGraph } from '../types';
2
-
3
- export declare function addDummyNodes(G: SankeyGraph): SankeyGraph;
4
- export declare function removeDummyNodes(G: SankeyGraph): void;
@@ -1,31 +0,0 @@
1
- import { SankeyGraph } from '../types';
2
-
3
- /**
4
- * Count the total number of crossings between 2 layers.
5
- *
6
- * This is the sum of the countBetweenCrossings and countLoopCrossings.
7
- *
8
- * @param {Graph} G - The graph.
9
- * @param {Array} orderA - List of node ids on left side.
10
- * @param {Array} orderB - List of node ids on right side.
11
- */
12
- export declare function countCrossings(G: SankeyGraph, orderA: string[], orderB: string[]): number;
13
- /**
14
- * Count the number of crossings of edges passing between 2 layers.
15
- *
16
- * Algorithm from
17
- * http://jgaa.info/accepted/2004/BarthMutzelJuenger2004.8.2.pdf
18
- *
19
- * @param {Graph} G - The graph.
20
- * @param {Array} orderA - List of node ids on left side.
21
- * @param {Array} orderB - List of node ids on right side.
22
- */
23
- export declare function countBetweenCrossings(G: SankeyGraph, orderA: string[], orderB: string[]): number;
24
- /**
25
- * Count the number of crossings from within-layer edges.
26
- *
27
- * @param {Graph} G - The graph.
28
- * @param {Array} orderA - List of node ids on left side.
29
- * @param {Array} orderB - List of node ids on right side.
30
- */
31
- export declare function countLoopCrossings(G: SankeyGraph, orderA: string[], orderB: string[]): number;
@@ -1,2 +0,0 @@
1
- export { addDummyNodes, removeDummyNodes } from './addDummyNodes';
2
- export { ordering } from './ordering';
@@ -1,3 +0,0 @@
1
- import { SankeyGraph } from '../types';
2
-
3
- export declare function initialOrdering(G: SankeyGraph): string[][];
@@ -1,12 +0,0 @@
1
- import { SankeyGraph } from '../types';
2
-
3
- /**
4
- * Return an ordering for the graph G.
5
- *
6
- * The ordering is a list of lists of node ids, corresponding to the ranks of
7
- * the graphs, and the order of nodes within each rank.
8
- *
9
- * @param {Graph} G - The graph. Nodes must have a `rank` attribute.
10
- *
11
- */
12
- export declare function ordering(G: SankeyGraph, maxIterations?: number): string[][][];
@@ -1,3 +0,0 @@
1
- import { SankeyGraph } from '../types';
2
-
3
- export declare function swapNodes(G: SankeyGraph, order: string[][]): void;
@@ -1,9 +0,0 @@
1
- import { SankeyGraph } from '../types';
2
-
3
- export declare function medianValue(positions: number[]): number;
4
- export declare function sortNodes(G: SankeyGraph, order: string[][], sweepDirection?: number, includeLoops?: boolean): void;
5
- export declare function neighbourPositions(G: SankeyGraph, order: string[][], i: number, j: number, u: string, includeLoops?: boolean): number[];
6
- /**
7
- * Sort arr according to order. -1 in order means stay in same position.
8
- */
9
- export declare function sortByPositions(arr: string[], order: Map<string, number>): void;
@@ -1,4 +0,0 @@
1
- import { LayoutGraph } from './justified';
2
-
3
- export declare function spanMinWidths(G: LayoutGraph, order: string[][][]): number[];
4
- export declare function positionHorizontally(G: LayoutGraph, order: string[][][], width: number, minWidths: number[]): void;
@@ -1,2 +0,0 @@
1
- export { positionHorizontally, spanMinWidths } from './horizontal';
2
- export { justifiedPositioning } from './justified';
@@ -1,63 +0,0 @@
1
- /**
2
- * Original, full-width node positioning.
3
- *
4
- * Uses spacing and whitespace fraction to position nodes within layers.
5
- *
6
- * @module node-positioning/justified
7
- */
8
- /** Shape of the mutable node object the layout algorithm reads and writes */
9
- export interface LayoutNode {
10
- value: number;
11
- dy: number;
12
- y: number;
13
- x: number;
14
- id: string;
15
- spaceAbove: number;
16
- spaceBelow: number;
17
- direction?: string;
18
- data?: {
19
- direction?: string;
20
- forceY?: number;
21
- };
22
- }
23
- /** Shape of the mutable edge object the layout algorithm reads and writes */
24
- interface LayoutEdge {
25
- data: {
26
- value: number;
27
- };
28
- value: number;
29
- dy: number;
30
- }
31
- /** Minimal structural interface for the graph object used by the layout algorithms */
32
- export interface LayoutGraph {
33
- nodes(): string[];
34
- node(id: string): LayoutNode;
35
- setNode(id: string, label: LayoutNode): void;
36
- inEdges(id: string): Array<{
37
- v: string;
38
- w: string;
39
- }>;
40
- outEdges(id: string): Array<{
41
- v: string;
42
- w: string;
43
- }>;
44
- edges(): Array<{
45
- v: string;
46
- w: string;
47
- }>;
48
- edge(e: {
49
- v: string;
50
- w: string;
51
- }): LayoutEdge;
52
- }
53
- type NodeId = string;
54
- type SeparationFn = (a: NodeId, b: NodeId, G: LayoutGraph) => number;
55
- export declare function justifiedPositioning(): {
56
- (G: LayoutGraph, order: NodeId[][][], edgeGap?: number): LayoutNode[];
57
- scaleToFit(G: LayoutGraph, order: NodeId[][][], edgeGap?: number): void;
58
- size(x?: number[]): number[] | any;
59
- separation(x?: SeparationFn | number): SeparationFn | any;
60
- whitespace(x?: number): number | any;
61
- scale(x?: number): number | any | null;
62
- };
63
- export {};
@@ -1,6 +0,0 @@
1
- import { RankSet, SankeyGraph } from '../types';
2
-
3
- /**
4
- * Assign ranks to the nodes in graph, according to rankSets.
5
- */
6
- export declare function assignRanks(graph: SankeyGraph, rankSets: RankSet[]): void;
@@ -1,10 +0,0 @@
1
- import { RankSet, SankeyGraph } from '../types';
2
-
3
- /**
4
- * Create a new graph where nodes in the same rank set are merged into one node.
5
- *
6
- * Depends on the "direction" attribute of the nodes in G, and the "delta"
7
- * atribute of the edges.
8
- *
9
- */
10
- export declare function groupedGraph(G: SankeyGraph, rankSets: RankSet[]): SankeyGraph;
@@ -1 +0,0 @@
1
- export { assignRanks } from './assignRanks';
@@ -1,6 +0,0 @@
1
- import { SankeyGraph } from '../types';
2
-
3
- /**
4
- * Take an acyclic graph and assign initial ranks to the nodes
5
- */
6
- export declare function assignInitialRanks(G: SankeyGraph): void;
@@ -1,12 +0,0 @@
1
- import { SankeyGraph } from '../types';
2
-
3
- /**
4
- * Reverse edges in G to make it acyclic
5
- */
6
- export declare function makeAcyclic(G: SankeyGraph, v0: string): SankeyGraph;
7
- export declare function findSpanningTree(G: SankeyGraph, v0: string): SankeyGraph;
8
- /**
9
- * Returns 1 if w is a descendent of v, -1 if v is a descendent of w, and 0 if
10
- * they are unrelated.
11
- */
12
- export declare function nodeRelationship(tree: SankeyGraph, v: string, w: string): number;
@@ -1,99 +0,0 @@
1
- /**
2
- * Shared structural types for the Sankey layout pipeline.
3
- * These mirror the subset of Graph methods used across layout modules.
4
- */
5
- export interface GraphEdge {
6
- v: string;
7
- w: string;
8
- name?: string;
9
- }
10
- /** Shape of node user data attached to a graph node */
11
- export interface NodeData {
12
- id?: string;
13
- title?: string;
14
- color?: string;
15
- direction?: string;
16
- forceY?: number;
17
- }
18
- /** A single waypoint along an edge path */
19
- export interface EdgePoint {
20
- d?: string;
21
- ro?: number;
22
- ri?: number;
23
- r0?: number;
24
- r1?: number;
25
- x?: number;
26
- y?: number;
27
- style?: string;
28
- }
29
- /** Label attached to a graph node during the layout pipeline */
30
- export interface NodeLabel {
31
- rank?: number;
32
- value?: number;
33
- dy?: number;
34
- y?: number;
35
- x?: number;
36
- id?: string;
37
- direction?: string;
38
- dummy?: boolean;
39
- spaceAbove?: number;
40
- spaceBelow?: number;
41
- data?: NodeData | null;
42
- incoming?: GraphEdge[];
43
- outgoing?: GraphEdge[];
44
- nodes?: string[];
45
- type?: string;
46
- depth?: number;
47
- thread?: string;
48
- }
49
- /** Label attached to a graph edge during the layout pipeline */
50
- export interface EdgeLabel {
51
- value?: number;
52
- dy?: number;
53
- x0?: number;
54
- y0?: number;
55
- x1?: number;
56
- y1?: number;
57
- d0?: string;
58
- d1?: string;
59
- r0?: number;
60
- r1?: number;
61
- Rmax?: number;
62
- points?: EdgePoint[];
63
- data?: Record<string, unknown> | null;
64
- origEdge?: GraphEdge;
65
- origLabel?: EdgeLabel;
66
- source?: NodeLabel;
67
- target?: NodeLabel;
68
- delta?: number;
69
- temp?: boolean;
70
- reversed?: boolean;
71
- reverse?: boolean;
72
- id?: string;
73
- }
74
- /** A rank set used to group nodes at the same rank level */
75
- export interface RankSet {
76
- type: string;
77
- nodes?: string[];
78
- }
79
- /** Generic graph interface for layout algorithms that only need basic traversal. */
80
- export interface SankeyGraph {
81
- nodes(): string[];
82
- node(id: string): NodeLabel;
83
- setNode(id: string, label: NodeLabel): void;
84
- edges(): GraphEdge[];
85
- edge(e: GraphEdge | string): EdgeLabel;
86
- edge(v: string, w: string, name?: string): EdgeLabel;
87
- setEdge(v: string, w: string, label: EdgeLabel, name?: string): void;
88
- setEdge(e: GraphEdge, label: EdgeLabel): void;
89
- removeEdge(e: GraphEdge): void;
90
- removeNode(id: string): void;
91
- hasEdge(v: string, w: string): boolean;
92
- hasNode(id: string): boolean;
93
- inEdges(id: string): GraphEdge[];
94
- outEdges(id: string): GraphEdge[];
95
- nodeEdges(u: string, v: string): GraphEdge[];
96
- sources(): string[];
97
- successors(id: string): string[];
98
- setGraph(label: unknown): void;
99
- }
@@ -1,13 +0,0 @@
1
- import { SankeyGraph } from './types';
2
-
3
- interface InputEdge {
4
- source: string;
5
- target: string;
6
- type: string;
7
- }
8
- interface InputNode {
9
- id: string;
10
- direction?: string;
11
- }
12
- export declare function createGraph(nodes?: InputNode[], edges?: InputEdge[]): SankeyGraph;
13
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Default color palette for sankey nodes.
3
- */
4
- export declare const DefaultPalette: string[];
@@ -1,17 +0,0 @@
1
- import { EdgeLabel } from '../layout/types';
2
-
3
- /** Minimal edge shape needed for geometry calculations */
4
- interface EdgeSegment {
5
- dy: number;
6
- x0: number;
7
- x1: number;
8
- y0: number;
9
- y1: number;
10
- r0?: number;
11
- r1?: number;
12
- d0?: string;
13
- d1?: string;
14
- }
15
- export declare function segmentPath(edge: EdgeSegment): string;
16
- export declare function generatePath(d: EdgeLabel): string | null;
17
- export {};
@@ -1,43 +0,0 @@
1
- import { Paper } from './Paper';
2
- import { SankeyOptions } from './Options';
3
- import { GraphEdge, SankeyGraph as SankeyGraphLayout } from '../layout/types';
4
- import { ChartContext, G } from '../../../../graph-utils/src/index.ts';
5
-
6
- export interface GraphPoint {
7
- readonly x: number;
8
- readonly y: number;
9
- }
10
- export interface Node {
11
- readonly color?: string;
12
- readonly id: string;
13
- readonly title: string;
14
- }
15
- export interface Edge {
16
- readonly source: string;
17
- readonly target: string;
18
- readonly type: string;
19
- readonly value: number;
20
- }
21
- export interface GraphData {
22
- readonly edges: Edge[];
23
- readonly nodes: Node[];
24
- readonly options: SankeyOptions;
25
- }
26
- export declare class SankeyGraph extends Paper {
27
- graph: SankeyGraphLayout;
28
- maxRank: number;
29
- /** Options resolved with CSS custom property overrides for the current render pass. */
30
- private renderOptions;
31
- /** Accessibility helper β€” re-created on each render pass. */
32
- private a11yHelper;
33
- /** Path highlighter β€” re-created on each render pass when feature is enabled. */
34
- private pathHighlighter;
35
- /** Guard: entrance animation plays only on the first render. */
36
- private _hasAnimated;
37
- constructor(element: HTMLElement, options: SankeyOptions, chartContext: ChartContext);
38
- construct(data: GraphData): void;
39
- render({ keepOldPosition }?: {
40
- keepOldPosition?: boolean | undefined;
41
- }): void;
42
- renderEdge(edgeObj: GraphEdge, group: G): void;
43
- }