apexsankey 1.2.5 → 1.3.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.
@@ -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): 1 | -1 | 0;
12
+ export declare function nodeRelationship(tree: any, v: any, w: any): 0 | 1 | -1;
@@ -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;
@@ -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
- constructor(element: HTMLElement, options: SankeyOptions);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apexsankey",
3
- "version": "1.2.5",
3
+ "version": "1.3.0",
4
4
  "dependencies": {
5
5
  "defined": "^1.0.1",
6
6
  "graphlib": "~2.1.0",
@@ -23,4 +23,4 @@
23
23
  }
24
24
  }
25
25
  }
26
- }
26
+ }