apexsankey 1.2.5 → 1.4.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.
- package/README.md +53 -38
- package/apexsankey.es.min.js +6217 -11254
- package/apexsankey.min.js +1 -9
- package/lib/layout/edgeOrdering/orderEdges.d.ts +3 -3
- package/lib/layout/layout.d.ts +6 -6
- package/lib/layout/nodePositioning/justified.d.ts +2 -2
- package/lib/layout/rankAssignment/makeAcyclic.d.ts +1 -1
- package/lib/models/ColorPalette.d.ts +3 -0
- package/lib/models/Graph.d.ts +2 -0
- package/lib/models/Options.d.ts +5 -1
- package/lib/models/Paper.d.ts +3 -1
- package/lib/sankey.d.ts +5 -7
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @module edge-ordering */
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Assign incoming and outgoing edge lists to each node.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* The actual sorting of edges for smooth flow is handled in linkLayout.ts
|
|
6
|
+
* where edges are sorted by connected node y-position before endpoint assignment.
|
|
7
7
|
*
|
|
8
8
|
* @param {Graph} G - The graph. Nodes must have `x` and `y` attributes.
|
|
9
9
|
*
|
package/lib/layout/layout.d.ts
CHANGED
|
@@ -16,24 +16,24 @@ export declare function sankey(options: Partial<SankeyOptions>): {
|
|
|
16
16
|
* @returns {sankeyLayout|Number[]}
|
|
17
17
|
*/
|
|
18
18
|
size(x: any): number[] | {
|
|
19
|
-
(G: any, order: any): any[];
|
|
20
|
-
scaleToFit(G: any, order: any): void;
|
|
19
|
+
(G: any, order: any, edgeGap?: number): any[];
|
|
20
|
+
scaleToFit(G: any, order: any, edgeGap?: number): void;
|
|
21
21
|
size(x?: any): number[] | any;
|
|
22
22
|
separation(x?: any): ((a: any, b: any, c: any) => number) | any;
|
|
23
23
|
whitespace(x?: number): number | any;
|
|
24
24
|
scale(x?: number): any;
|
|
25
25
|
} | any;
|
|
26
26
|
separation(x: any): ((a: any, b: any, c: any) => number) | {
|
|
27
|
-
(G: any, order: any): any[];
|
|
28
|
-
scaleToFit(G: any, order: any): void;
|
|
27
|
+
(G: any, order: any, edgeGap?: number): any[];
|
|
28
|
+
scaleToFit(G: any, order: any, edgeGap?: number): void;
|
|
29
29
|
size(x?: any): number[] | any;
|
|
30
30
|
separation(x?: any): ((a: any, b: any, c: any) => number) | any;
|
|
31
31
|
whitespace(x?: number): number | any;
|
|
32
32
|
scale(x?: number): any;
|
|
33
33
|
} | any;
|
|
34
34
|
whitespace(x: any): number | {
|
|
35
|
-
(G: any, order: any): any[];
|
|
36
|
-
scaleToFit(G: any, order: any): void;
|
|
35
|
+
(G: any, order: any, edgeGap?: number): any[];
|
|
36
|
+
scaleToFit(G: any, order: any, edgeGap?: number): void;
|
|
37
37
|
size(x?: any): number[] | any;
|
|
38
38
|
separation(x?: any): ((a: any, b: any, c: any) => number) | any;
|
|
39
39
|
whitespace(x?: number): number | any;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module node-positioning/justified
|
|
7
7
|
*/
|
|
8
8
|
export declare function justifiedPositioning(): {
|
|
9
|
-
(G: any, order: any): any[];
|
|
10
|
-
scaleToFit(G: any, order: any): void;
|
|
9
|
+
(G: any, order: any, edgeGap?: number): any[];
|
|
10
|
+
scaleToFit(G: any, order: any, edgeGap?: number): void;
|
|
11
11
|
size(x?: any): number[] | any;
|
|
12
12
|
separation(x?: any): ((a: any, b: any, c: any) => number) | any;
|
|
13
13
|
whitespace(x?: number): number | any;
|
|
@@ -9,4 +9,4 @@ export declare function findSpanningTree(G: any, v0: any): Graph;
|
|
|
9
9
|
* Returns 1 if w is a descendent of v, -1 if v is a descendent of w, and 0 if
|
|
10
10
|
* they are unrelated.
|
|
11
11
|
*/
|
|
12
|
-
export declare function nodeRelationship(tree: any, v: any, w: any):
|
|
12
|
+
export declare function nodeRelationship(tree: any, v: any, w: any): 0 | 1 | -1;
|
package/lib/models/Graph.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Paper } from './Paper';
|
|
|
2
2
|
import { SankeyOptions } from './Options';
|
|
3
3
|
import { Graph } from 'graphlib';
|
|
4
4
|
import { G } from '@svgdotjs/svg.js';
|
|
5
|
+
import { ChartContext } from '../../../../graph-utils/src/index.ts';
|
|
5
6
|
|
|
6
7
|
export interface GraphPoint {
|
|
7
8
|
readonly x: number;
|
|
@@ -26,6 +27,7 @@ export interface GraphData {
|
|
|
26
27
|
export declare class SankeyGraph extends Paper {
|
|
27
28
|
graph: Graph;
|
|
28
29
|
maxRank: number;
|
|
30
|
+
constructor(element: HTMLElement, options: SankeyOptions, chartContext: ChartContext);
|
|
29
31
|
construct(data: GraphData): void;
|
|
30
32
|
render({ keepOldPosition }?: {
|
|
31
33
|
keepOldPosition?: boolean;
|
package/lib/models/Options.d.ts
CHANGED
|
@@ -14,9 +14,13 @@ export interface NodeOptions {
|
|
|
14
14
|
readonly onNodeClick?: (node: any) => void;
|
|
15
15
|
}
|
|
16
16
|
export interface EdgeOptions {
|
|
17
|
+
readonly edgeGap: number;
|
|
17
18
|
readonly edgeGradientFill: boolean;
|
|
18
19
|
readonly edgeOpacity: number;
|
|
19
20
|
}
|
|
21
|
+
export interface LayoutOptions {
|
|
22
|
+
readonly whitespace: number;
|
|
23
|
+
}
|
|
20
24
|
export interface FontOptions {
|
|
21
25
|
readonly fontColor: string;
|
|
22
26
|
readonly fontFamily: string;
|
|
@@ -30,5 +34,5 @@ export interface TooltipOptions {
|
|
|
30
34
|
readonly tooltipId: string;
|
|
31
35
|
readonly tooltipTemplate?: (content: any) => string;
|
|
32
36
|
}
|
|
33
|
-
export type SankeyOptions = CommonOptions & EdgeOptions & FontOptions & NodeOptions & TooltipOptions;
|
|
37
|
+
export type SankeyOptions = CommonOptions & EdgeOptions & FontOptions & LayoutOptions & NodeOptions & TooltipOptions;
|
|
34
38
|
export declare const DefaultOptions: SankeyOptions;
|
package/lib/models/Paper.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { SankeyOptions } from './Options';
|
|
2
2
|
import { Element, Svg } from '@svgdotjs/svg.js';
|
|
3
|
+
import { ChartContext } from '../../../../graph-utils/src/index.ts';
|
|
3
4
|
|
|
4
5
|
export declare class Paper {
|
|
5
6
|
element: HTMLElement;
|
|
6
7
|
options: SankeyOptions;
|
|
8
|
+
protected chartContext: ChartContext;
|
|
7
9
|
canvas: Svg;
|
|
8
|
-
constructor(element: HTMLElement, options: SankeyOptions);
|
|
10
|
+
constructor(element: HTMLElement, options: SankeyOptions, chartContext: ChartContext);
|
|
9
11
|
private getYShift;
|
|
10
12
|
add(element: Element): void;
|
|
11
13
|
clear(): void;
|
package/lib/sankey.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { SankeyOptions } from './models/Options';
|
|
2
2
|
import { GraphData, SankeyGraph } from './models/Graph';
|
|
3
|
+
import { BaseChart } from '../../../graph-utils/src/index.ts';
|
|
3
4
|
|
|
4
|
-
export declare class ApexSankey {
|
|
5
|
-
element: HTMLElement;
|
|
6
|
-
options: SankeyOptions;
|
|
5
|
+
export declare class ApexSankey extends BaseChart {
|
|
7
6
|
graph: SankeyGraph;
|
|
8
|
-
|
|
7
|
+
options: SankeyOptions;
|
|
8
|
+
constructor(element: HTMLElement, options?: Partial<SankeyOptions>);
|
|
9
9
|
static setLicense(key: string): void;
|
|
10
|
-
|
|
11
|
-
* Handle watermark display based on license validation
|
|
12
|
-
*/
|
|
10
|
+
private setupElementDimensions;
|
|
13
11
|
private handleWatermark;
|
|
14
12
|
render(data: GraphData): SankeyGraph;
|
|
15
13
|
}
|