@hpcc-js/graph 2.83.1 → 2.84.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 (56) hide show
  1. package/dist/index.es6.js +1145 -266
  2. package/dist/index.es6.js.map +1 -1
  3. package/dist/index.js +1146 -262
  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/__package__.ts +2 -2
  9. package/src/graph2/dataGraph.ts +27 -25
  10. package/src/graph2/edge.tsx +30 -0
  11. package/src/graph2/graph.ts +46 -1311
  12. package/src/graph2/graphReactT.ts +43 -0
  13. package/src/graph2/graphT.ts +1315 -0
  14. package/src/graph2/index.ts +5 -0
  15. package/src/graph2/layouts/dagre.ts +17 -4
  16. package/src/graph2/layouts/forceDirected.ts +2 -2
  17. package/src/graph2/layouts/graphviz.ts +1 -1
  18. package/src/graph2/layouts/graphvizWorker.ts +2 -2
  19. package/src/graph2/layouts/placeholders.ts +46 -37
  20. package/src/graph2/layouts/tree.ts +1 -1
  21. package/src/graph2/sankeyGraph.ts +8 -12
  22. package/src/graph2/subgraph.tsx +30 -0
  23. package/src/graph2/vertex.tsx +31 -0
  24. package/types/__package__.d.ts +2 -2
  25. package/types/graph2/dataGraph.d.ts +4 -4
  26. package/types/graph2/dataGraph.d.ts.map +1 -1
  27. package/types/graph2/edge.d.ts +9 -0
  28. package/types/graph2/edge.d.ts.map +1 -0
  29. package/types/graph2/graph.d.ts +25 -234
  30. package/types/graph2/graph.d.ts.map +1 -1
  31. package/types/graph2/graphReactT.d.ts +15 -0
  32. package/types/graph2/graphReactT.d.ts.map +1 -0
  33. package/types/graph2/graphT.d.ts +233 -0
  34. package/types/graph2/graphT.d.ts.map +1 -0
  35. package/types/graph2/index.d.ts +5 -0
  36. package/types/graph2/index.d.ts.map +1 -1
  37. package/types/graph2/layouts/dagre.d.ts.map +1 -1
  38. package/types/graph2/layouts/placeholders.d.ts +44 -37
  39. package/types/graph2/layouts/placeholders.d.ts.map +1 -1
  40. package/types/graph2/sankeyGraph.d.ts +5 -5
  41. package/types/graph2/sankeyGraph.d.ts.map +1 -1
  42. package/types/graph2/subgraph.d.ts +12 -0
  43. package/types/graph2/subgraph.d.ts.map +1 -0
  44. package/types/graph2/vertex.d.ts +13 -0
  45. package/types/graph2/vertex.d.ts.map +1 -0
  46. package/types-3.4/__package__.d.ts +2 -2
  47. package/types-3.4/graph2/dataGraph.d.ts +4 -4
  48. package/types-3.4/graph2/edge.d.ts +9 -0
  49. package/types-3.4/graph2/graph.d.ts +25 -234
  50. package/types-3.4/graph2/graphReactT.d.ts +15 -0
  51. package/types-3.4/graph2/graphT.d.ts +233 -0
  52. package/types-3.4/graph2/index.d.ts +5 -0
  53. package/types-3.4/graph2/layouts/placeholders.d.ts +47 -37
  54. package/types-3.4/graph2/sankeyGraph.d.ts +5 -5
  55. package/types-3.4/graph2/subgraph.d.ts +12 -0
  56. package/types-3.4/graph2/vertex.d.ts +13 -0
@@ -1,156 +1,33 @@
1
- import { Palette, Selection, SVGGlowFilter, SVGZoomWidget, ToggleButton, Utility, Widget } from "@hpcc-js/common";
2
- import { IconEx, React, Vertex, IVertex3, IVertex4Annotation, Icon } from "@hpcc-js/react";
3
- import { Graph2 as GraphCollection } from "@hpcc-js/util";
4
- import { HTMLTooltip } from "@hpcc-js/html";
5
- import "d3-transition";
6
- import { ILayout } from "./layouts/index";
7
- import { Options as FDOptions } from "./layouts/forceDirectedWorker";
8
- import { IEdge, IGraphData2, IHierarchy, ISubgraph, IVertex } from "./layouts/placeholders";
9
- import { EdgePlaceholder, SubgraphPlaceholder, VertexPlaceholder } from "./layouts/placeholders";
10
- import { Engine } from "./layouts/graphvizWorker";
11
- import "../../src/graph2/graph.css";
12
- export { IGraphData2, ISubgraph, IVertex, IEdge, IHierarchy };
13
- declare type GraphLayoutType = "Hierarchy" | "DOT" | "Tree" | "Dendrogram" | "RadialTree" | "RadialDendrogram" | "ForceDirected" | "ForceDirected2" | "ForceDirectedHybrid" | "Neato" | "FDP" | "Circle" | "TwoPI" | "Circo" | "None";
14
- export declare class Graph2 extends SVGZoomWidget {
15
- private _toggleHierarchy;
16
- private _toggleForceDirected;
17
- private _toggleForceDirected2;
18
- private _toggleCircle;
19
- private _toggleDot;
20
- private _toggleNeato;
21
- private _toggleFDP;
22
- private _toggleTwoPI;
23
- private _toggleCirco;
24
- private _toggleT;
25
- private _toggleRT;
26
- private _toggleD;
27
- private _toggleRD;
28
- protected _graphData: GraphCollection<VertexPlaceholder, EdgePlaceholder, SubgraphPlaceholder>;
29
- protected _prevDoClickTime: number;
30
- protected _centroidFilter: SVGGlowFilter;
31
- protected _svgDefsAnn: any;
32
- protected _svgDefsCat: any;
33
- protected _subgraphG: Selection<SVGGElement, any, SVGGElement, any>;
34
- protected _edgeG: Selection<SVGGElement, any, SVGGElement, any>;
35
- protected _vertexG: Selection<SVGGElement, any, SVGGElement, any>;
36
- protected _tooltip: HTMLTooltip;
37
- protected _selection: Utility.SelectionBag;
38
- private _dragHandler;
39
- protected _catPalette: Palette.OrdinalPaletteFunc;
40
- _svgDefs: any;
1
+ import { React, SubgraphProps, VertexProps } from "@hpcc-js/react";
2
+ import { BasicEdgeProps } from "./edge";
3
+ import { GraphReactT } from "./graphReactT";
4
+ export declare class Graph2 extends GraphReactT<SubgraphProps, VertexProps, BasicEdgeProps> {
41
5
  constructor();
42
- resolveEventOrigin(): {
43
- origin: string;
44
- data: undefined | IVertex4Annotation | Icon;
45
- };
46
- iconBarButtons(): Widget[];
47
- protected _categories: IconEx[];
48
- categories(): IconEx[];
49
- categories(_: IconEx[]): this;
50
- protected _annotations: IconEx[];
51
- annotations(): IconEx[];
52
- annotations(_: IconEx[]): this;
53
- private _origData;
54
- data(): IGraphData2;
55
- data(_: IGraphData2, merge?: boolean): this;
56
- selected(vertex: IVertex, _?: Array<IVertex>): boolean;
57
- selection(_: Array<IVertex | ISubgraph | IEdge>): this;
58
- selection(): Array<IVertex | ISubgraph | IEdge>;
59
- graphData(): GraphCollection<VertexPlaceholder, EdgePlaceholder>;
60
- resetLayout(): this;
61
- layoutRunning(): boolean;
62
- protected _layoutAlgo: ILayout;
63
- layoutAlgo(layout: ILayout): Promise<void>;
64
- layoutClick(layout: GraphLayoutType): void;
65
- updateIconBarItem(tb: ToggleButton, tbLayout: GraphLayoutType): void;
66
- updateIconBar(): void;
67
- getNeighborMap(vertex: VertexPlaceholder): {
68
- vertices: {};
69
- edges: {};
70
- };
71
- centerOnItem(id: string): void;
72
- hideVertex(id: string): this;
73
- showVertex(id: string): this;
74
- protected highlight: {
75
- zoom: number;
76
- opacity: number;
77
- edge: string;
78
- };
79
- highlightVerticies(vertexMap?: {
80
- [id: string]: boolean;
81
- }): this;
82
- highlightEdges(edgeMap: any): this;
83
- highlightVertex(_element: any, d: VertexPlaceholder): void;
84
- highlightEdge(_element: any, d: EdgePlaceholder): void;
85
- moveSubgraphPlaceholder(sp: SubgraphPlaceholder, transition: boolean): this;
86
- moveEdgePlaceholder(ep: EdgePlaceholder, transition: boolean): this;
87
- moveVertexPlaceholder(vp: VertexPlaceholder, transition: boolean, moveNeighbours: boolean): this;
88
- moveSubgraphs(transition: boolean): this;
89
- moveEdges(transition: boolean): this;
90
- moveVertices(transition: boolean): this;
91
- project(pos: number, clip?: boolean): number;
92
- rproject(pos: number): number;
93
- projectPlacholder(vp: VertexPlaceholder): {
94
- x: number;
95
- y: number;
96
- };
97
- categoryID(id: string | number, prefix?: "cat" | "ann"): string;
98
- updateCategories(): void;
99
- updateAnnotations(): void;
100
- updateEdges(): this;
101
- private _centroidRenderer;
102
- centroidRenderer(): React.FunctionComponent;
103
- centroidRenderer(_: React.FunctionComponent): this;
104
- private _vertexRenderer;
105
- vertexRenderer(): React.FunctionComponent;
106
- vertexRenderer(_: React.FunctionComponent): this;
107
- vertexMapper(props: IVertex, origRow: any): Vertex | IVertex3;
108
- updateVertices(): this;
109
- calcProps(isCentroid: boolean, props: any): any;
110
- hasSubgraphs(): boolean;
111
- updateSubgraphs(): this;
6
+ calcProps(_props: VertexProps): VertexProps;
7
+ protected _reactVertexRenderer2: React.FunctionComponent<VertexProps>;
8
+ vertexRenderer(): React.FunctionComponent<VertexProps>;
9
+ vertexRenderer(_: React.FunctionComponent<VertexProps>): this;
10
+ protected _reactCentroidRenderer: React.FunctionComponent<VertexProps>;
11
+ centroidRenderer(): React.FunctionComponent<VertexProps>;
12
+ centroidRenderer(_: React.FunctionComponent<VertexProps>): this;
112
13
  enter(domNode: any, element: any): void;
113
- protected forceDirectedOptions(): FDOptions;
114
- private layoutOptions;
115
- private _prevLayout;
116
- updateLayout(): void;
117
14
  update(domNode: any, element: any): void;
118
- exit(domNode: any, element: any): void;
119
- render(callback?: (w: Widget) => void): this;
120
- private _prevWidth;
121
- private _prevHeight;
122
- private _prevTransformScale;
123
- private _transformScale;
124
- zoomed(transform: any): void;
125
- centroids(): VertexPlaceholder[];
126
- selectionChanged(): void;
127
- tooltipHTML(data: any): any;
128
- subgraph_click(row: any, _col: any, sel: any): void;
129
- vertex_click(row: any, _col: any, sel: any, data: any): void;
130
- vertex_dblclick(row: any, _col: any, sel: any, data: any): void;
131
- vertex_mousein(row: any, _col: any, sel: any, data: any): void;
132
- vertex_mouseover(row: any, _col: any, sel: any, data: any): void;
133
- vertex_mouseout(row: any, _col: any, sel: any, data: any): void;
134
- edge_click(row: any, _col: any, sel: any): void;
135
- edge_mouseover(element: any, d: any): void;
136
- edge_mouseout(_element: any, _d: any): void;
137
- progress(what: "start" | "stop" | "layout-start" | "layout-tick" | "layout-stop"): void;
138
15
  }
139
16
  export interface Graph2 {
140
- allowDragging(): boolean;
141
- allowDragging(_: boolean): this;
142
- dragSingleNeighbors(): boolean;
143
- dragSingleNeighbors(_: boolean): this;
144
- layout(): GraphLayoutType;
145
- layout(_: GraphLayoutType): this;
146
- applyScaleOnLayout(): boolean;
147
- applyScaleOnLayout(_: boolean): this;
148
- highlightOnMouseOverVertex(): boolean;
149
- highlightOnMouseOverVertex(_: boolean): this;
150
- highlightOnMouseOverEdge(): boolean;
151
- highlightOnMouseOverEdge(_: boolean): this;
152
- transitionDuration(): number;
153
- transitionDuration(_: number): this;
17
+ vertexTextHeight(): number;
18
+ vertexTextHeight(_: number): this;
19
+ vertexTextPadding(): number;
20
+ vertexTextPadding(_: number): this;
21
+ vertexIconHeight(): number;
22
+ vertexIconHeight(_: number): this;
23
+ vertexIconPadding(): number;
24
+ vertexIconPadding(_: number): this;
25
+ vertexIconStrokeWidth(): number;
26
+ vertexIconStrokeWidth(_: number): this;
27
+ vertexIconFontFamily(): string;
28
+ vertexIconFontFamily(_: string): this;
29
+ vertexLabelFontFamily(): string;
30
+ vertexLabelFontFamily(_: string): this;
154
31
  centroidColor(): string;
155
32
  centroidColor(_: string): this;
156
33
  centroidScale(): number;
@@ -169,91 +46,5 @@ export interface Graph2 {
169
46
  centroidIconFontFamily(_: string): this;
170
47
  centroidLabelFontFamily(): string;
171
48
  centroidLabelFontFamily(_: string): this;
172
- vertexTextHeight(): number;
173
- vertexTextHeight(_: number): this;
174
- vertexTextPadding(): number;
175
- vertexTextPadding(_: number): this;
176
- vertexIconHeight(): number;
177
- vertexIconHeight(_: number): this;
178
- vertexIconPadding(): number;
179
- vertexIconPadding(_: number): this;
180
- vertexIconStrokeWidth(): number;
181
- vertexIconStrokeWidth(_: number): this;
182
- vertexIconFontFamily(): string;
183
- vertexIconFontFamily(_: string): this;
184
- vertexLabelFontFamily(): string;
185
- vertexLabelFontFamily(_: string): this;
186
- highlightSelectedPathToCentroid(): boolean;
187
- highlightSelectedPathToCentroid(_: boolean): this;
188
- edgeArcDepth(): number;
189
- edgeArcDepth(_: number): this;
190
- minScale(): number;
191
- minScale(_: number): this;
192
- maxScale(): number;
193
- maxScale(_: number): this;
194
- showEdgeLabels(): boolean;
195
- showEdgeLabels(_: boolean): this;
196
- showEdgeLabelsOnHighlight(): boolean;
197
- showEdgeLabelsOnHighlight(_: boolean): this;
198
- showVertexLabels(): boolean;
199
- showVertexLabels(_: boolean): this;
200
- showVertexLabelsOnHighlight(): boolean;
201
- showVertexLabelsOnHighlight(_: boolean): this;
202
- hierarchyRankDirection(): "TB" | "BT" | "LR" | "RL";
203
- hierarchyRankDirection(_: "TB" | "BT" | "LR" | "RL"): this;
204
- hierarchyNodeSeparation(): number;
205
- hierarchyNodeSeparation(_: number): this;
206
- hierarchyEdgeSeparation(): number;
207
- hierarchyEdgeSeparation(_: number): this;
208
- hierarchyRankSeparation(): number;
209
- hierarchyRankSeparation(_: number): this;
210
- hierarchyDigraph(): boolean;
211
- hierarchyDigraph(_: boolean): this;
212
- forceDirectedAlpha(): number;
213
- forceDirectedAlpha(_: number): this;
214
- forceDirectedAlphaMin(): number;
215
- forceDirectedAlphaMin(_: number): this;
216
- forceDirectedAlphaDecay(): number;
217
- forceDirectedAlphaDecay(_: number): this;
218
- forceDirectedRepulsionStrength(): number;
219
- forceDirectedRepulsionStrength(_: number): this;
220
- forceDirectedVelocityDecay(): number;
221
- forceDirectedVelocityDecay(_: number): this;
222
- forceDirectedIterations(): number;
223
- forceDirectedIterations(_: number): this;
224
- forceDirectedLinkDistance(): number;
225
- forceDirectedLinkDistance(_: number): this;
226
- forceDirectedLinkStrength(): number;
227
- forceDirectedLinkStrength(_: number): this;
228
- forceDirectedPinCentroid(): boolean;
229
- forceDirectedPinCentroid(_: boolean): this;
230
- forceDirectedForceStrength(): number;
231
- forceDirectedForceStrength(_: number): this;
232
- forceDirectedMinDistance(): number;
233
- forceDirectedMinDistance(_: number): this;
234
- forceDirectedMaxDistance(): number;
235
- forceDirectedMaxDistance(_: number): this;
236
- treeRankDirection(): "TB" | "LR";
237
- treeRankDirection(_: "TB" | "LR"): this;
238
- edgeColor(): string;
239
- edgeColor(_: string): this;
240
- edgeStrokeWidth(): number;
241
- edgeStrokeWidth(_: number): this;
242
- tooltipWidth(): number;
243
- tooltipWidth(_: number): this;
244
- tooltipHeight(): number;
245
- tooltipHeight(_: number): this;
246
- enableTooltipPointerEvents(): boolean;
247
- enableTooltipPointerEvents(_: boolean): this;
248
- tooltipCloseDelay(): number;
249
- tooltipCloseDelay(_: number): this;
250
- doubleClickMaxDelay(): number;
251
- doubleClickMaxDelay(_: number): this;
252
- wasmFolder(): string;
253
- wasmFolder(_: string): this;
254
49
  }
255
- export declare function graphviz(dot: string, engine?: Engine, _wasmFolder?: string): {
256
- terminate: () => void;
257
- response: Promise<string>;
258
- };
259
50
  //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { React, SubgraphProps, VertexProps } from "@hpcc-js/react";
2
+ import { EdgeProps, GraphT } from "./graphT";
3
+ export declare class GraphReactT<SG extends SubgraphProps, V extends VertexProps, E extends EdgeProps> extends GraphT<SG, V, E> {
4
+ constructor(subgraphRenderer: React.FunctionComponent<SG>, vertexRenderer: React.FunctionComponent<V>, edgeRenderer: React.FunctionComponent<E>);
5
+ private _reactSubgraphRenderer;
6
+ subgraphRenderer(): React.FunctionComponent<SG>;
7
+ subgraphRenderer(_: React.FunctionComponent<SG>): this;
8
+ private _reactVertexRenderer;
9
+ vertexRenderer(): React.FunctionComponent<V>;
10
+ vertexRenderer(_: React.FunctionComponent<V>): this;
11
+ private _reactEdgeRenderer;
12
+ edgeRenderer(): React.FunctionComponent<E>;
13
+ edgeRenderer(_: React.FunctionComponent<E>): this;
14
+ }
15
+ //# sourceMappingURL=graphReactT.d.ts.map
@@ -0,0 +1,233 @@
1
+ import { Palette, Selection, SVGGlowFilter, SVGZoomWidget, ToggleButton, Utility, Widget } from "@hpcc-js/common";
2
+ import { IconEx } from "@hpcc-js/react";
3
+ import { Graph2 as GraphCollection } from "@hpcc-js/util";
4
+ import { HTMLTooltip } from "@hpcc-js/html";
5
+ import "d3-transition";
6
+ import { ILayout } from "./layouts/index";
7
+ import { Options as FDOptions } from "./layouts/forceDirectedWorker";
8
+ import { VertexProps, EdgeProps, IGraphData2, HierarchyBase, SubgraphProps } from "./layouts/placeholders";
9
+ import { EdgePlaceholder, SubgraphPlaceholder, VertexPlaceholder } from "./layouts/placeholders";
10
+ import { Engine } from "./layouts/graphvizWorker";
11
+ import "../../src/graph2/graph.css";
12
+ export { IGraphData2, SubgraphProps, VertexProps, EdgeProps, HierarchyBase };
13
+ declare type GraphLayoutType = "Hierarchy" | "DOT" | "Tree" | "Dendrogram" | "RadialTree" | "RadialDendrogram" | "ForceDirected" | "ForceDirected2" | "ForceDirectedHybrid" | "Neato" | "FDP" | "Circle" | "TwoPI" | "Circo" | "None";
14
+ export declare type RendererT<T> = (props: T, element: SVGGElement) => void;
15
+ export declare class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends EdgeProps> extends SVGZoomWidget {
16
+ protected _centroidFilter: SVGGlowFilter;
17
+ private _toggleHierarchy;
18
+ private _toggleForceDirected;
19
+ private _toggleForceDirected2;
20
+ private _toggleCircle;
21
+ private _toggleDot;
22
+ private _toggleNeato;
23
+ private _toggleFDP;
24
+ private _toggleTwoPI;
25
+ private _toggleCirco;
26
+ private _toggleT;
27
+ private _toggleRT;
28
+ private _toggleD;
29
+ private _toggleRD;
30
+ protected _graphData: GraphCollection<VertexPlaceholder<V>, EdgePlaceholder<E, V>, SubgraphPlaceholder<SG>>;
31
+ protected _prevDoClickTime: number;
32
+ protected _svgDefsAnn: any;
33
+ protected _svgDefsCat: any;
34
+ protected _subgraphG: Selection<SVGGElement, any, SVGGElement, any>;
35
+ protected _edgeG: Selection<SVGGElement, any, SVGGElement, any>;
36
+ protected _vertexG: Selection<SVGGElement, any, SVGGElement, any>;
37
+ protected _tooltip: HTMLTooltip;
38
+ protected _selection: Utility.SelectionBag;
39
+ private _dragHandler;
40
+ protected _catPalette: Palette.OrdinalPaletteFunc;
41
+ _svgDefs: any;
42
+ constructor(subgraphRenderer: RendererT<SG>, vertexRenderer: RendererT<V>, edgeRenderer: RendererT<E>);
43
+ resolveEventOrigin(): {
44
+ origin: string;
45
+ data?: SG | V | E;
46
+ };
47
+ iconBarButtons(): Widget[];
48
+ protected _categories: IconEx[];
49
+ categories(): IconEx[];
50
+ categories(_: IconEx[]): this;
51
+ protected _annotations: IconEx[];
52
+ annotations(): IconEx[];
53
+ annotations(_: IconEx[]): this;
54
+ private _origData;
55
+ data(): IGraphData2<SG, V, E>;
56
+ data(_: IGraphData2<SG, V, E>, merge?: boolean): this;
57
+ selected(vertex: V, _?: Array<V>): boolean;
58
+ selection(_: Array<V | SG | E>): this;
59
+ selection(): Array<V | SG | E>;
60
+ graphData(): GraphCollection<VertexPlaceholder<V>, EdgePlaceholder<E, V>>;
61
+ resetLayout(): this;
62
+ layoutRunning(): boolean;
63
+ protected _layoutAlgo: ILayout;
64
+ layoutAlgo(layout: ILayout): Promise<void>;
65
+ layoutClick(layout: GraphLayoutType): void;
66
+ updateIconBarItem(tb: ToggleButton, tbLayout: GraphLayoutType): void;
67
+ updateIconBar(): void;
68
+ getNeighborMap(vertex: VertexPlaceholder<V>): {
69
+ vertices: {};
70
+ edges: {};
71
+ };
72
+ centerOnItem(id: string): void;
73
+ hideVertex(id: string): this;
74
+ showVertex(id: string): this;
75
+ protected highlight: {
76
+ zoom: number;
77
+ opacity: number;
78
+ edge: string;
79
+ };
80
+ highlightVerticies(vertexMap?: {
81
+ [id: string]: boolean;
82
+ }): this;
83
+ highlightEdges(edgeMap?: {
84
+ [id: string]: boolean;
85
+ }): this;
86
+ highlightVertex(_element: any, d?: VertexPlaceholder<V>): void;
87
+ highlightEdge(_element: any, d?: EdgePlaceholder<E, V>): void;
88
+ moveSubgraphPlaceholder(sp: SubgraphPlaceholder<SG>, transition: boolean): this;
89
+ moveEdgePlaceholder(ep: EdgePlaceholder<E, V>, transition: boolean): this;
90
+ moveVertexPlaceholder(vp: VertexPlaceholder<V>, transition: boolean, moveNeighbours: boolean): this;
91
+ moveSubgraphs(transition: boolean): this;
92
+ moveEdges(transition: boolean): this;
93
+ moveVertices(transition: boolean): this;
94
+ project(pos: number, clip?: boolean): number;
95
+ rproject(pos: number): number;
96
+ projectPlacholder(vp: VertexPlaceholder<V>): {
97
+ x: number;
98
+ y: number;
99
+ };
100
+ categoryID(id: string | number, prefix?: "cat" | "ann"): string;
101
+ updateCategories(): void;
102
+ updateAnnotations(): void;
103
+ private _edgeRenderer;
104
+ edgeRenderer(): RendererT<E>;
105
+ edgeRenderer(_: RendererT<E>): this;
106
+ updateEdges(): this;
107
+ private _vertexRenderer;
108
+ vertexRenderer(): RendererT<V>;
109
+ vertexRenderer(_: RendererT<V>): this;
110
+ vertexMapper(props: V, origRow: V): V;
111
+ updateVertices(): this;
112
+ calcProps(props: V): V;
113
+ hasSubgraphs(): boolean;
114
+ private _subgraphRenderer;
115
+ subgraphRenderer(): RendererT<SG>;
116
+ subgraphRenderer(_: RendererT<SG>): this;
117
+ updateSubgraphs(): this;
118
+ enter(domNode: any, element: any): void;
119
+ protected forceDirectedOptions(): FDOptions;
120
+ private layoutOptions;
121
+ private _prevLayout;
122
+ updateLayout(): void;
123
+ update(domNode: any, element: any): void;
124
+ exit(domNode: any, element: any): void;
125
+ render(callback?: (w: Widget) => void): this;
126
+ private _prevWidth;
127
+ private _prevHeight;
128
+ private _prevTransformScale;
129
+ private _transformScale;
130
+ zoomed(transform: any): void;
131
+ centroids(): VertexPlaceholder<V>[];
132
+ selectionChanged(): void;
133
+ tooltipHTML(data: any): any;
134
+ subgraph_click(row: any, _col: any, sel: any): void;
135
+ vertex_click(row: any, _col: any, sel: any, data: any): void;
136
+ vertex_dblclick(row: any, _col: any, sel: any, data: any): void;
137
+ vertex_mousein(row: any, _col: any, sel: any, data: any): void;
138
+ vertex_mouseover(row: any, _col: any, sel: any, data: any): void;
139
+ vertex_mouseout(row: any, _col: any, sel: any, data: any): void;
140
+ edge_click(row: any, _col: any, sel: any): void;
141
+ edge_mouseover(element: any, d: any): void;
142
+ edge_mouseout(_element: any, _d: any): void;
143
+ progress(what: "start" | "stop" | "layout-start" | "layout-tick" | "layout-stop"): void;
144
+ }
145
+ export interface GraphT<SG extends SubgraphProps = any, V extends VertexProps = any, E extends EdgeProps = any> {
146
+ allowDragging(): boolean;
147
+ allowDragging(_: boolean): this;
148
+ dragSingleNeighbors(): boolean;
149
+ dragSingleNeighbors(_: boolean): this;
150
+ layout(): GraphLayoutType;
151
+ layout(_: GraphLayoutType): this;
152
+ applyScaleOnLayout(): boolean;
153
+ applyScaleOnLayout(_: boolean): this;
154
+ highlightOnMouseOverVertex(): boolean;
155
+ highlightOnMouseOverVertex(_: boolean): this;
156
+ highlightOnMouseOverEdge(): boolean;
157
+ highlightOnMouseOverEdge(_: boolean): this;
158
+ transitionDuration(): number;
159
+ transitionDuration(_: number): this;
160
+ highlightSelectedPathToCentroid(): boolean;
161
+ highlightSelectedPathToCentroid(_: boolean): this;
162
+ edgeArcDepth(): number;
163
+ edgeArcDepth(_: number): this;
164
+ minScale(): number;
165
+ minScale(_: number): this;
166
+ maxScale(): number;
167
+ maxScale(_: number): this;
168
+ showEdgeLabels(): boolean;
169
+ showEdgeLabels(_: boolean): this;
170
+ showEdgeLabelsOnHighlight(): boolean;
171
+ showEdgeLabelsOnHighlight(_: boolean): this;
172
+ showVertexLabels(): boolean;
173
+ showVertexLabels(_: boolean): this;
174
+ showVertexLabelsOnHighlight(): boolean;
175
+ showVertexLabelsOnHighlight(_: boolean): this;
176
+ hierarchyRankDirection(): "TB" | "BT" | "LR" | "RL";
177
+ hierarchyRankDirection(_: "TB" | "BT" | "LR" | "RL"): this;
178
+ hierarchyNodeSeparation(): number;
179
+ hierarchyNodeSeparation(_: number): this;
180
+ hierarchyEdgeSeparation(): number;
181
+ hierarchyEdgeSeparation(_: number): this;
182
+ hierarchyRankSeparation(): number;
183
+ hierarchyRankSeparation(_: number): this;
184
+ hierarchyDigraph(): boolean;
185
+ hierarchyDigraph(_: boolean): this;
186
+ forceDirectedAlpha(): number;
187
+ forceDirectedAlpha(_: number): this;
188
+ forceDirectedAlphaMin(): number;
189
+ forceDirectedAlphaMin(_: number): this;
190
+ forceDirectedAlphaDecay(): number;
191
+ forceDirectedAlphaDecay(_: number): this;
192
+ forceDirectedRepulsionStrength(): number;
193
+ forceDirectedRepulsionStrength(_: number): this;
194
+ forceDirectedVelocityDecay(): number;
195
+ forceDirectedVelocityDecay(_: number): this;
196
+ forceDirectedIterations(): number;
197
+ forceDirectedIterations(_: number): this;
198
+ forceDirectedLinkDistance(): number;
199
+ forceDirectedLinkDistance(_: number): this;
200
+ forceDirectedLinkStrength(): number;
201
+ forceDirectedLinkStrength(_: number): this;
202
+ forceDirectedPinCentroid(): boolean;
203
+ forceDirectedPinCentroid(_: boolean): this;
204
+ forceDirectedForceStrength(): number;
205
+ forceDirectedForceStrength(_: number): this;
206
+ forceDirectedMinDistance(): number;
207
+ forceDirectedMinDistance(_: number): this;
208
+ forceDirectedMaxDistance(): number;
209
+ forceDirectedMaxDistance(_: number): this;
210
+ treeRankDirection(): "TB" | "LR";
211
+ treeRankDirection(_: "TB" | "LR"): this;
212
+ edgeColor(): string;
213
+ edgeColor(_: string): this;
214
+ edgeStrokeWidth(): number;
215
+ edgeStrokeWidth(_: number): this;
216
+ tooltipWidth(): number;
217
+ tooltipWidth(_: number): this;
218
+ tooltipHeight(): number;
219
+ tooltipHeight(_: number): this;
220
+ enableTooltipPointerEvents(): boolean;
221
+ enableTooltipPointerEvents(_: boolean): this;
222
+ tooltipCloseDelay(): number;
223
+ tooltipCloseDelay(_: number): this;
224
+ doubleClickMaxDelay(): number;
225
+ doubleClickMaxDelay(_: number): this;
226
+ wasmFolder(): string;
227
+ wasmFolder(_: string): this;
228
+ }
229
+ export declare function graphviz(dot: string, engine?: Engine, _scriptDir?: string): {
230
+ terminate: () => void;
231
+ response: Promise<string>;
232
+ };
233
+ //# sourceMappingURL=graphT.d.ts.map
@@ -1,4 +1,9 @@
1
+ export * from "./graphT";
2
+ export * from "./graphReactT";
1
3
  export * from "./graph";
2
4
  export * from "./dataGraph";
3
5
  export * from "./sankeyGraph";
6
+ export * from "./subgraph";
7
+ export * from "./vertex";
8
+ export * from "./edge";
4
9
  //# sourceMappingURL=index.d.ts.map
@@ -1,48 +1,58 @@
1
1
  import { Selection } from "@hpcc-js/common";
2
- import { Edge, Subgraph, Vertex } from "@hpcc-js/react";
3
- export interface ISubgraph extends Subgraph {
4
- id: string;
2
+ export interface BaseProps {
3
+ id: string | number;
5
4
  origData?: any;
6
5
  }
7
- export interface IVertex extends Vertex {
8
- id: string;
9
- origData?: any;
6
+ export interface VertexProps extends BaseProps {
7
+ text: string;
8
+ categoryID?: string;
10
9
  centroid?: boolean;
11
10
  hidden?: boolean;
12
11
  tooltip?: string;
12
+ annotationIDs?: string[];
13
+ }
14
+ export interface SubgraphProps extends BaseProps {
15
+ text: string;
16
+ width?: number;
17
+ height?: number;
13
18
  }
14
- export interface IEdge extends Edge {
15
- id: string;
16
- source: IVertex;
17
- target: IVertex;
19
+ export declare type Point = [
20
+ number,
21
+ number
22
+ ];
23
+ export interface EdgeProps extends BaseProps {
24
+ source: VertexProps;
25
+ target: VertexProps;
18
26
  label?: string;
27
+ labelPos?: Point;
28
+ weight?: number;
29
+ strokeDasharray?: string;
30
+ strokeWidth?: number;
19
31
  color?: string;
20
32
  fontFamily?: string;
21
- origData?: any;
22
33
  }
23
- export interface IHierarchy {
24
- id: string;
25
- parent: ISubgraph;
26
- child: ISubgraph | IVertex;
34
+ export interface HierarchyBase<SG extends SubgraphProps, V extends VertexProps> {
35
+ id: string | number;
36
+ parent: SG;
37
+ child: SG | V;
27
38
  }
28
- export interface IGraphData2 {
29
- subgraphs?: ISubgraph[];
30
- vertices: IVertex[];
31
- edges: IEdge[];
32
- hierarchy?: IHierarchy[];
39
+ export interface IGraphData2<SG extends SubgraphProps, V extends VertexProps, E extends EdgeProps> {
40
+ subgraphs?: SG[];
41
+ vertices: V[];
42
+ edges: E[];
43
+ hierarchy?: HierarchyBase<SG, V>[];
33
44
  }
34
- export interface SubgraphPlaceholder {
35
- id: string;
36
- element?: Selection<SVGGElement, SubgraphPlaceholder, SVGGElement, any>;
37
- props: ISubgraph;
45
+ export interface SubgraphPlaceholder<SG extends SubgraphProps = SubgraphProps> {
46
+ id: string | number;
47
+ element?: Selection<SVGGElement, SubgraphPlaceholder<SG>, SVGGElement, any>;
48
+ props: SG;
38
49
  x?: number;
39
50
  y?: number;
40
51
  }
41
- export interface VertexPlaceholder {
42
- id: string;
43
- element?: Selection<SVGGElement, VertexPlaceholder, SVGGElement, any>;
44
- props: IVertex;
45
- centroid?: boolean;
52
+ export interface VertexPlaceholder<V extends VertexProps = VertexProps> {
53
+ id: string | number;
54
+ element?: Selection<SVGGElement, VertexPlaceholder<V>, SVGGElement, any>;
55
+ props: V;
46
56
  index?: number;
47
57
  x?: number;
48
58
  y?: number;
@@ -55,14 +65,14 @@ export interface VertexPlaceholder {
55
65
  lat?: number;
56
66
  lng?: number;
57
67
  }
58
- export interface EdgePlaceholder {
59
- id: string;
60
- element?: Selection<SVGGElement, EdgePlaceholder, SVGGElement, any>;
61
- elementPath?: Selection<SVGPathElement, EdgePlaceholder, SVGGElement, any>;
62
- elementText?: Selection<SVGTextElement, EdgePlaceholder, SVGGElement, any>;
63
- props: IEdge;
64
- source: VertexPlaceholder;
65
- target: VertexPlaceholder;
68
+ export interface EdgePlaceholder<E extends EdgeProps = EdgeProps, V extends VertexProps = VertexProps> {
69
+ id: string | number;
70
+ element?: Selection<SVGGElement, EdgePlaceholder<E, V>, SVGGElement, any>;
71
+ elementPath?: Selection<SVGPathElement, EdgePlaceholder<E, V>, SVGGElement, any>;
72
+ elementText?: Selection<SVGTextElement, EdgePlaceholder<E, V>, SVGGElement, any>;
73
+ props: E;
74
+ source: VertexPlaceholder<V>;
75
+ target: VertexPlaceholder<V>;
66
76
  index?: number;
67
77
  points?: Array<[
68
78
  number,
@@ -1,7 +1,7 @@
1
1
  import { publish, SVGWidget } from "@hpcc-js/common";
2
2
  import { AnnotationColumn } from "./dataGraph";
3
- import { IEdge, IVertex } from "./graph";
4
3
  import "../../src/graph2/sankeyGraph.css";
4
+ import { EdgeProps, VertexProps } from "./graphT";
5
5
  export declare class SankeyGraph extends SVGWidget {
6
6
  vertexColumns: publish<this, string[]>;
7
7
  vertices: publish<this, Array<Array<string | number | boolean>>>;
@@ -29,12 +29,12 @@ export declare class SankeyGraph extends SVGWidget {
29
29
  private _masterVerticesMap;
30
30
  mergeVertices(): void;
31
31
  indexOf(columns: readonly string[], column: string, defColumn?: string): number;
32
- protected _prevEdges: readonly IEdge[];
33
- protected _masterEdges: IEdge[];
32
+ protected _prevEdges: readonly EdgeProps[];
33
+ protected _masterEdges: EdgeProps[];
34
34
  mergeEdges(): void;
35
35
  sankeyData(): {
36
- vertices: IVertex[];
37
- edges: IEdge[];
36
+ vertices: VertexProps[];
37
+ edges: EdgeProps[];
38
38
  };
39
39
  enter(domNode: any, element: any): void;
40
40
  update(domNode: any, element: any): void;