@hpcc-js/graph 2.69.0 → 2.73.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 (43) hide show
  1. package/dist/index.es6.js +424 -26
  2. package/dist/index.es6.js.map +1 -1
  3. package/dist/index.js +425 -25
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/package.json +9 -8
  8. package/src/Sankey.ts +35 -14
  9. package/src/__package__.ts +2 -2
  10. package/src/graph2/dataGraph.ts +34 -13
  11. package/src/graph2/graph.ts +38 -30
  12. package/src/graph2/index.ts +1 -0
  13. package/src/graph2/layouts/graphviz.ts +33 -1
  14. package/src/graph2/layouts/placeholders.ts +1 -0
  15. package/src/graph2/sankeyGraph.css +45 -0
  16. package/src/graph2/sankeyGraph.ts +322 -0
  17. package/src/test.ts +49 -4
  18. package/types/Sankey.d.ts +8 -0
  19. package/types/Sankey.d.ts.map +1 -1
  20. package/types/__package__.d.ts +2 -2
  21. package/types/graph2/dataGraph.d.ts +3 -0
  22. package/types/graph2/dataGraph.d.ts.map +1 -1
  23. package/types/graph2/graph.d.ts +3 -1
  24. package/types/graph2/graph.d.ts.map +1 -1
  25. package/types/graph2/index.d.ts +1 -0
  26. package/types/graph2/index.d.ts.map +1 -1
  27. package/types/graph2/layouts/graphviz.d.ts +6 -1
  28. package/types/graph2/layouts/graphviz.d.ts.map +1 -1
  29. package/types/graph2/layouts/placeholders.d.ts +1 -0
  30. package/types/graph2/layouts/placeholders.d.ts.map +1 -1
  31. package/types/graph2/sankeyGraph.d.ts +73 -0
  32. package/types/graph2/sankeyGraph.d.ts.map +1 -0
  33. package/types/test.d.ts +6 -1
  34. package/types/test.d.ts.map +1 -1
  35. package/types-3.4/Sankey.d.ts +8 -0
  36. package/types-3.4/__package__.d.ts +2 -2
  37. package/types-3.4/graph2/dataGraph.d.ts +3 -0
  38. package/types-3.4/graph2/graph.d.ts +3 -1
  39. package/types-3.4/graph2/index.d.ts +1 -0
  40. package/types-3.4/graph2/layouts/graphviz.d.ts +6 -1
  41. package/types-3.4/graph2/layouts/placeholders.d.ts +1 -0
  42. package/types-3.4/graph2/sankeyGraph.d.ts +73 -0
  43. package/types-3.4/test.d.ts +6 -1
@@ -0,0 +1,73 @@
1
+ import { publish, SVGWidget } from "@hpcc-js/common";
2
+ import { AnnotationColumn } from "./dataGraph";
3
+ import { IEdge, IVertex } from "./graph";
4
+ import "../../src/graph2/sankeyGraph.css";
5
+ export declare class SankeyGraph extends SVGWidget {
6
+ vertexColumns: publish<this, string[]>;
7
+ vertices: publish<this, Array<Array<string | number | boolean>>>;
8
+ vertexCategoryColumn: publish<this, string>;
9
+ vertexIDColumn: publish<this, string>;
10
+ vertexLabelColumn: publish<this, string>;
11
+ vertexCentroidColumn: publish<this, string>;
12
+ vertexFAChar: publish<this, string>;
13
+ vertexFACharColumn: publish<this, string>;
14
+ vertexTooltipColumn: publish<this, string>;
15
+ vertexAnnotationColumns: publish<this, AnnotationColumn[]>;
16
+ edgeColumns: publish<this, string[]>;
17
+ edges: publish<this, Array<Array<string | number | boolean>>>;
18
+ edgeIDColumn: publish<this, string>;
19
+ edgeLabelColumn: publish<this, string>;
20
+ edgeSourceColumn: publish<this, string>;
21
+ edgeTargetColumn: publish<this, string>;
22
+ edgeWeightColumn: publish<this, string>;
23
+ protected _d3Sankey: any;
24
+ protected _selection: any;
25
+ _palette: any;
26
+ constructor();
27
+ private _prevVertices;
28
+ private _masterVertices;
29
+ private _masterVerticesMap;
30
+ mergeVertices(): void;
31
+ indexOf(columns: readonly string[], column: string, defColumn?: string): number;
32
+ protected _prevEdges: readonly IEdge[];
33
+ protected _masterEdges: IEdge[];
34
+ mergeEdges(): void;
35
+ sankeyData(): {
36
+ vertices: IVertex[];
37
+ edges: IEdge[];
38
+ };
39
+ enter(domNode: any, element: any): void;
40
+ update(domNode: any, element: any): void;
41
+ paletteID: {
42
+ (): string;
43
+ (_: string): SankeyGraph;
44
+ };
45
+ vertexStrokeWidth: {
46
+ (): number;
47
+ (_: number): SankeyGraph;
48
+ };
49
+ vertexStrokeColor: {
50
+ (): string;
51
+ (_: string): SankeyGraph;
52
+ };
53
+ vertexWidth: {
54
+ (): number;
55
+ (_: number): SankeyGraph;
56
+ };
57
+ vertexPadding: {
58
+ (): number;
59
+ (_: number): SankeyGraph;
60
+ };
61
+ xAxisMovement: {
62
+ (): boolean;
63
+ (_: boolean): SankeyGraph;
64
+ };
65
+ yAxisMovement: {
66
+ (): boolean;
67
+ (_: boolean): SankeyGraph;
68
+ };
69
+ exit(domNode: any, element: any): void;
70
+ click(row: any, column: any, selected: any): void;
71
+ dblclick(row: any, column: any, selected: any): void;
72
+ }
73
+ //# sourceMappingURL=sankeyGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sankeyGraph.d.ts","sourceRoot":"","sources":["../../src/graph2/sankeyGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,SAAS,EAAW,MAAM,iBAAiB,CAAC;AAIvE,OAAO,EAAE,gBAAgB,EAAa,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,kCAAkC,CAAC;AAE1C,qBAAa,WAAY,SAAQ,SAAS;IAEtC,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAEvC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAEjE,oBAAoB,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE5C,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAEtC,iBAAiB,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAEzC,oBAAoB,EAAE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,EAAE,CAAM;IACrC,UAAU;IAgCV,UAAU;;;;IASV,KAAK,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA;IAOtB,MAAM,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA;IA2IvB,SAAS,EAAE;QAAE,IAAI,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;KAAE,CAAC;IACrD,iBAAiB,EAAE;QAAE,IAAI,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;KAAE,CAAC;IAC7D,iBAAiB,EAAE;QAAE,IAAI,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;KAAE,CAAC;IAC7D,WAAW,EAAE;QAAE,IAAI,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;KAAE,CAAC;IACvD,aAAa,EAAE;QAAE,IAAI,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;KAAE,CAAC;IACzD,aAAa,EAAE;QAAE,IAAI,OAAO,CAAC;QAAC,CAAC,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;KAAE,CAAC;IAC3D,aAAa,EAAE;QAAE,IAAI,OAAO,CAAC;QAAC,CAAC,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;KAAE,CAAC;IAE3D,IAAI,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA;IAKrB,KAAK,CAAC,GAAG,KAAA,EAAE,MAAM,KAAA,EAAE,QAAQ,KAAA;IAI3B,QAAQ,CAAC,GAAG,KAAA,EAAE,MAAM,KAAA,EAAE,QAAQ,KAAA;CAGjC"}
package/types/test.d.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  import { Graph } from "./Graph";
2
2
  import { DataGraph } from "./graph2/dataGraph";
3
+ import { SankeyGraph } from "./graph2/sankeyGraph";
4
+ export { Test3 as Test };
3
5
  export declare class Test1 extends Graph {
4
6
  constructor();
5
7
  }
6
- export declare class Test extends DataGraph {
8
+ export declare class Test2 extends DataGraph {
9
+ constructor();
10
+ }
11
+ export declare class Test3 extends SankeyGraph {
7
12
  constructor();
8
13
  }
9
14
  //# sourceMappingURL=test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,qBAAa,KAAM,SAAQ,KAAK;;CAa/B;AAED,qBAAa,IAAK,SAAQ,SAAS;;CA+ElC"}
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC;AAEzB,qBAAa,KAAM,SAAQ,KAAK;;CAa/B;AAED,qBAAa,KAAM,SAAQ,SAAS;;CA6EnC;AAED,qBAAa,KAAM,SAAQ,WAAW;;CA0CrC"}
@@ -41,6 +41,14 @@ export declare class Sankey extends SVGWidget {
41
41
  (): SankeyColumn[];
42
42
  (_: SankeyColumn[]): Sankey;
43
43
  };
44
+ vertexStrokeWidth: {
45
+ (): number;
46
+ (_: number): Sankey;
47
+ };
48
+ vertexStrokeColor: {
49
+ (): string;
50
+ (_: string): Sankey;
51
+ };
44
52
  vertexWidth: {
45
53
  (): number;
46
54
  (_: number): Sankey;
@@ -1,4 +1,4 @@
1
1
  export declare const PKG_NAME = "@hpcc-js/graph";
2
- export declare const PKG_VERSION = "2.69.0";
3
- export declare const BUILD_VERSION = "2.85.0";
2
+ export declare const PKG_VERSION = "2.73.0";
3
+ export declare const BUILD_VERSION = "2.94.0";
4
4
  //# sourceMappingURL=__package__.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import { PropertyExt, publish, Widget } from "@hpcc-js/common";
2
2
  import { Graph2 } from "./graph";
3
3
  import { IEdge } from "./layouts/placeholders";
4
+ export declare function toJsonObj(row: any, columns: any): {};
4
5
  export declare class AnnotationColumn extends PropertyExt {
5
6
  columnID: publish<this, string>;
6
7
  annotationID: publish<this, string>;
@@ -31,6 +32,7 @@ export declare class DataGraph extends Graph2 {
31
32
  edgeSourceColumn: publish<this, string>;
32
33
  edgeTargetColumn: publish<this, string>;
33
34
  edgeWeightColumn: publish<this, string>;
35
+ edgeColorColumn: publish<this, string>;
34
36
  hierarchyColumns: publish<this, string[]>;
35
37
  hierarchy: publish<this, Array<Array<string | number | boolean>>>;
36
38
  hierarchyParentIDColumn: publish<this, string>;
@@ -48,6 +50,7 @@ export declare class DataGraph extends Graph2 {
48
50
  mergeVertices(): void;
49
51
  protected _prevEdges: readonly IEdge[];
50
52
  protected _masterEdges: IEdge[];
53
+ private _masterEdgesMap;
51
54
  mergeEdges(): void;
52
55
  private _prevHierarchy;
53
56
  private _masterHierarchy;
@@ -52,7 +52,7 @@ export declare class Graph2 extends SVGZoomWidget {
52
52
  selection(_: Array<IVertex | ISubgraph | IEdge>): this;
53
53
  selection(): Array<IVertex | ISubgraph | IEdge>;
54
54
  graphData(): GraphCollection<VertexPlaceholder, EdgePlaceholder>;
55
- resetLayout(): void;
55
+ resetLayout(): this;
56
56
  layoutRunning(): boolean;
57
57
  protected _layoutAlgo: ILayout;
58
58
  layoutAlgo(layout: ILayout): Promise<void>;
@@ -228,6 +228,8 @@ export interface Graph2 {
228
228
  forceDirectedMinDistance(_: number): this;
229
229
  forceDirectedMaxDistance(): number;
230
230
  forceDirectedMaxDistance(_: number): this;
231
+ treeRankDirection(): "TB" | "LR";
232
+ treeRankDirection(_: "TB" | "LR"): this;
231
233
  edgeColor(): string;
232
234
  edgeColor(_: string): this;
233
235
  edgeStrokeWidth(): number;
@@ -1,3 +1,4 @@
1
1
  export * from "./graph";
2
2
  export * from "./dataGraph";
3
+ export * from "./sankeyGraph";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,10 +1,15 @@
1
- import { Layout } from "./layout";
1
+ import { Layout, Point } from "./layout";
2
+ import { EdgePlaceholder } from "./placeholders";
2
3
  declare type Engine = "circo" | "dot" | "fdp" | "neato" | "osage" | "patchwork" | "twopi";
3
4
  export declare class Graphviz extends Layout {
4
5
  _engine: Engine;
5
6
  _wasmFolder: string;
6
7
  constructor(graph: any, engine: Engine, wasmFolder: string);
7
8
  start(): Promise<this>;
9
+ edgePath(ep: EdgePlaceholder, curveDepth: number): {
10
+ path: string;
11
+ labelPos: Point;
12
+ };
8
13
  }
9
14
  export {};
10
15
  //# sourceMappingURL=graphviz.d.ts.map
@@ -16,6 +16,7 @@ export interface IEdge extends Edge {
16
16
  source: IVertex;
17
17
  target: IVertex;
18
18
  label?: string;
19
+ color?: string;
19
20
  fontFamily?: string;
20
21
  origData?: any;
21
22
  }
@@ -0,0 +1,73 @@
1
+ import { publish, SVGWidget } from "@hpcc-js/common";
2
+ import { AnnotationColumn } from "./dataGraph";
3
+ import { IEdge, IVertex } from "./graph";
4
+ import "../../src/graph2/sankeyGraph.css";
5
+ export declare class SankeyGraph extends SVGWidget {
6
+ vertexColumns: publish<this, string[]>;
7
+ vertices: publish<this, Array<Array<string | number | boolean>>>;
8
+ vertexCategoryColumn: publish<this, string>;
9
+ vertexIDColumn: publish<this, string>;
10
+ vertexLabelColumn: publish<this, string>;
11
+ vertexCentroidColumn: publish<this, string>;
12
+ vertexFAChar: publish<this, string>;
13
+ vertexFACharColumn: publish<this, string>;
14
+ vertexTooltipColumn: publish<this, string>;
15
+ vertexAnnotationColumns: publish<this, AnnotationColumn[]>;
16
+ edgeColumns: publish<this, string[]>;
17
+ edges: publish<this, Array<Array<string | number | boolean>>>;
18
+ edgeIDColumn: publish<this, string>;
19
+ edgeLabelColumn: publish<this, string>;
20
+ edgeSourceColumn: publish<this, string>;
21
+ edgeTargetColumn: publish<this, string>;
22
+ edgeWeightColumn: publish<this, string>;
23
+ protected _d3Sankey: any;
24
+ protected _selection: any;
25
+ _palette: any;
26
+ constructor();
27
+ private _prevVertices;
28
+ private _masterVertices;
29
+ private _masterVerticesMap;
30
+ mergeVertices(): void;
31
+ indexOf(columns: readonly string[], column: string, defColumn?: string): number;
32
+ protected _prevEdges: readonly IEdge[];
33
+ protected _masterEdges: IEdge[];
34
+ mergeEdges(): void;
35
+ sankeyData(): {
36
+ vertices: IVertex[];
37
+ edges: IEdge[];
38
+ };
39
+ enter(domNode: any, element: any): void;
40
+ update(domNode: any, element: any): void;
41
+ paletteID: {
42
+ (): string;
43
+ (_: string): SankeyGraph;
44
+ };
45
+ vertexStrokeWidth: {
46
+ (): number;
47
+ (_: number): SankeyGraph;
48
+ };
49
+ vertexStrokeColor: {
50
+ (): string;
51
+ (_: string): SankeyGraph;
52
+ };
53
+ vertexWidth: {
54
+ (): number;
55
+ (_: number): SankeyGraph;
56
+ };
57
+ vertexPadding: {
58
+ (): number;
59
+ (_: number): SankeyGraph;
60
+ };
61
+ xAxisMovement: {
62
+ (): boolean;
63
+ (_: boolean): SankeyGraph;
64
+ };
65
+ yAxisMovement: {
66
+ (): boolean;
67
+ (_: boolean): SankeyGraph;
68
+ };
69
+ exit(domNode: any, element: any): void;
70
+ click(row: any, column: any, selected: any): void;
71
+ dblclick(row: any, column: any, selected: any): void;
72
+ }
73
+ //# sourceMappingURL=sankeyGraph.d.ts.map
@@ -1,9 +1,14 @@
1
1
  import { Graph } from "./Graph";
2
2
  import { DataGraph } from "./graph2/dataGraph";
3
+ import { SankeyGraph } from "./graph2/sankeyGraph";
4
+ export { Test3 as Test };
3
5
  export declare class Test1 extends Graph {
4
6
  constructor();
5
7
  }
6
- export declare class Test extends DataGraph {
8
+ export declare class Test2 extends DataGraph {
9
+ constructor();
10
+ }
11
+ export declare class Test3 extends SankeyGraph {
7
12
  constructor();
8
13
  }
9
14
  //# sourceMappingURL=test.d.ts.map