@hpcc-js/graph 2.83.1 → 2.83.2

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 (55) hide show
  1. package/dist/index.es6.js +1139 -260
  2. package/dist/index.es6.js.map +1 -1
  3. package/dist/index.js +1139 -256
  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 +8 -7
  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 +48 -1308
  12. package/src/graph2/graphReactT.ts +43 -0
  13. package/src/graph2/graphT.ts +1311 -0
  14. package/src/graph2/index.ts +4 -0
  15. package/src/graph2/layouts/dagre.ts +13 -1
  16. package/src/graph2/layouts/forceDirected.ts +2 -2
  17. package/src/graph2/layouts/graphvizWorker.ts +2 -2
  18. package/src/graph2/layouts/placeholders.ts +41 -32
  19. package/src/graph2/layouts/tree.ts +1 -1
  20. package/src/graph2/sankeyGraph.ts +8 -12
  21. package/src/graph2/subgraph.tsx +30 -0
  22. package/src/graph2/vertex.tsx +31 -0
  23. package/types/__package__.d.ts +2 -2
  24. package/types/graph2/dataGraph.d.ts +4 -4
  25. package/types/graph2/dataGraph.d.ts.map +1 -1
  26. package/types/graph2/edge.d.ts +9 -0
  27. package/types/graph2/edge.d.ts.map +1 -0
  28. package/types/graph2/graph.d.ts +26 -233
  29. package/types/graph2/graph.d.ts.map +1 -1
  30. package/types/graph2/graphReactT.d.ts +15 -0
  31. package/types/graph2/graphReactT.d.ts.map +1 -0
  32. package/types/graph2/graphT.d.ts +232 -0
  33. package/types/graph2/graphT.d.ts.map +1 -0
  34. package/types/graph2/index.d.ts +4 -0
  35. package/types/graph2/index.d.ts.map +1 -1
  36. package/types/graph2/layouts/dagre.d.ts.map +1 -1
  37. package/types/graph2/layouts/placeholders.d.ts +39 -32
  38. package/types/graph2/layouts/placeholders.d.ts.map +1 -1
  39. package/types/graph2/sankeyGraph.d.ts +5 -5
  40. package/types/graph2/sankeyGraph.d.ts.map +1 -1
  41. package/types/graph2/subgraph.d.ts +12 -0
  42. package/types/graph2/subgraph.d.ts.map +1 -0
  43. package/types/graph2/vertex.d.ts +13 -0
  44. package/types/graph2/vertex.d.ts.map +1 -0
  45. package/types-3.4/__package__.d.ts +2 -2
  46. package/types-3.4/graph2/dataGraph.d.ts +4 -4
  47. package/types-3.4/graph2/edge.d.ts +9 -0
  48. package/types-3.4/graph2/graph.d.ts +26 -233
  49. package/types-3.4/graph2/graphReactT.d.ts +15 -0
  50. package/types-3.4/graph2/graphT.d.ts +232 -0
  51. package/types-3.4/graph2/index.d.ts +4 -0
  52. package/types-3.4/graph2/layouts/placeholders.d.ts +42 -32
  53. package/types-3.4/graph2/sankeyGraph.d.ts +5 -5
  54. package/types-3.4/graph2/subgraph.d.ts +12 -0
  55. package/types-3.4/graph2/vertex.d.ts +13 -0
@@ -1,156 +1,35 @@
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;
1
+ import { SVGGlowFilter } from "@hpcc-js/common";
2
+ import { React, SubgraphProps, VertexProps } from "@hpcc-js/react";
3
+ import { BasicEdgeProps } from "./edge";
4
+ import { GraphReactT } from "./graphReactT";
5
+ export declare class Graph2 extends GraphReactT<SubgraphProps, VertexProps, BasicEdgeProps> {
30
6
  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;
41
7
  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;
8
+ calcProps(_props: VertexProps): VertexProps;
9
+ protected _reactVertexRenderer2: React.FunctionComponent<VertexProps>;
10
+ vertexRenderer(): React.FunctionComponent<VertexProps>;
11
+ vertexRenderer(_: React.FunctionComponent<VertexProps>): this;
12
+ protected _reactCentroidRenderer: React.FunctionComponent<VertexProps>;
13
+ centroidRenderer(): React.FunctionComponent<VertexProps>;
14
+ centroidRenderer(_: React.FunctionComponent<VertexProps>): this;
112
15
  enter(domNode: any, element: any): void;
113
- protected forceDirectedOptions(): FDOptions;
114
- private layoutOptions;
115
- private _prevLayout;
116
- updateLayout(): void;
117
16
  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
17
  }
139
18
  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;
19
+ vertexTextHeight(): number;
20
+ vertexTextHeight(_: number): this;
21
+ vertexTextPadding(): number;
22
+ vertexTextPadding(_: number): this;
23
+ vertexIconHeight(): number;
24
+ vertexIconHeight(_: number): this;
25
+ vertexIconPadding(): number;
26
+ vertexIconPadding(_: number): this;
27
+ vertexIconStrokeWidth(): number;
28
+ vertexIconStrokeWidth(_: number): this;
29
+ vertexIconFontFamily(): string;
30
+ vertexIconFontFamily(_: string): this;
31
+ vertexLabelFontFamily(): string;
32
+ vertexLabelFontFamily(_: string): this;
154
33
  centroidColor(): string;
155
34
  centroidColor(_: string): this;
156
35
  centroidScale(): number;
@@ -169,91 +48,5 @@ export interface Graph2 {
169
48
  centroidIconFontFamily(_: string): this;
170
49
  centroidLabelFontFamily(): string;
171
50
  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
51
  }
255
- export declare function graphviz(dot: string, engine?: Engine, _wasmFolder?: string): {
256
- terminate: () => void;
257
- response: Promise<string>;
258
- };
259
52
  //# 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,232 @@
1
+ import { Palette, Selection, 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
+ private _toggleHierarchy;
17
+ private _toggleForceDirected;
18
+ private _toggleForceDirected2;
19
+ private _toggleCircle;
20
+ private _toggleDot;
21
+ private _toggleNeato;
22
+ private _toggleFDP;
23
+ private _toggleTwoPI;
24
+ private _toggleCirco;
25
+ private _toggleT;
26
+ private _toggleRT;
27
+ private _toggleD;
28
+ private _toggleRD;
29
+ protected _graphData: GraphCollection<VertexPlaceholder<V>, EdgePlaceholder<E, V>, SubgraphPlaceholder<SG>>;
30
+ protected _prevDoClickTime: number;
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;
41
+ constructor(subgraphRenderer: RendererT<SG>, vertexRenderer: RendererT<V>, edgeRenderer: RendererT<E>);
42
+ resolveEventOrigin(): {
43
+ origin: string;
44
+ data?: SG | V | E;
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<SG, V, E>;
55
+ data(_: IGraphData2<SG, V, E>, merge?: boolean): this;
56
+ selected(vertex: V, _?: Array<V>): boolean;
57
+ selection(_: Array<V | SG | E>): this;
58
+ selection(): Array<V | SG | E>;
59
+ graphData(): GraphCollection<VertexPlaceholder<V>, EdgePlaceholder<E, V>>;
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<V>): {
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?: {
83
+ [id: string]: boolean;
84
+ }): this;
85
+ highlightVertex(_element: any, d?: VertexPlaceholder<V>): void;
86
+ highlightEdge(_element: any, d?: EdgePlaceholder<E, V>): void;
87
+ moveSubgraphPlaceholder(sp: SubgraphPlaceholder<SG>, transition: boolean): this;
88
+ moveEdgePlaceholder(ep: EdgePlaceholder<E, V>, transition: boolean): this;
89
+ moveVertexPlaceholder(vp: VertexPlaceholder<V>, transition: boolean, moveNeighbours: boolean): this;
90
+ moveSubgraphs(transition: boolean): this;
91
+ moveEdges(transition: boolean): this;
92
+ moveVertices(transition: boolean): this;
93
+ project(pos: number, clip?: boolean): number;
94
+ rproject(pos: number): number;
95
+ projectPlacholder(vp: VertexPlaceholder<V>): {
96
+ x: number;
97
+ y: number;
98
+ };
99
+ categoryID(id: string | number, prefix?: "cat" | "ann"): string;
100
+ updateCategories(): void;
101
+ updateAnnotations(): void;
102
+ private _edgeRenderer;
103
+ edgeRenderer(): RendererT<E>;
104
+ edgeRenderer(_: RendererT<E>): this;
105
+ updateEdges(): this;
106
+ private _vertexRenderer;
107
+ vertexRenderer(): RendererT<V>;
108
+ vertexRenderer(_: RendererT<V>): this;
109
+ vertexMapper(props: V, origRow: V): V;
110
+ updateVertices(): this;
111
+ calcProps(props: V): V;
112
+ hasSubgraphs(): boolean;
113
+ private _subgraphRenderer;
114
+ subgraphRenderer(): RendererT<SG>;
115
+ subgraphRenderer(_: RendererT<SG>): this;
116
+ updateSubgraphs(): this;
117
+ enter(domNode: any, element: any): void;
118
+ protected forceDirectedOptions(): FDOptions;
119
+ private layoutOptions;
120
+ private _prevLayout;
121
+ updateLayout(): void;
122
+ update(domNode: any, element: any): void;
123
+ exit(domNode: any, element: any): void;
124
+ render(callback?: (w: Widget) => void): this;
125
+ private _prevWidth;
126
+ private _prevHeight;
127
+ private _prevTransformScale;
128
+ private _transformScale;
129
+ zoomed(transform: any): void;
130
+ centroids(): VertexPlaceholder<V>[];
131
+ selectionChanged(): void;
132
+ tooltipHTML(data: any): any;
133
+ subgraph_click(row: any, _col: any, sel: any): void;
134
+ vertex_click(row: any, _col: any, sel: any, data: any): void;
135
+ vertex_dblclick(row: any, _col: any, sel: any, data: any): void;
136
+ vertex_mousein(row: any, _col: any, sel: any, data: any): void;
137
+ vertex_mouseover(row: any, _col: any, sel: any, data: any): void;
138
+ vertex_mouseout(row: any, _col: any, sel: any, data: any): void;
139
+ edge_click(row: any, _col: any, sel: any): void;
140
+ edge_mouseover(element: any, d: any): void;
141
+ edge_mouseout(_element: any, _d: any): void;
142
+ progress(what: "start" | "stop" | "layout-start" | "layout-tick" | "layout-stop"): void;
143
+ }
144
+ export interface GraphT<SG extends SubgraphProps = any, V extends VertexProps = any, E extends EdgeProps = any> {
145
+ allowDragging(): boolean;
146
+ allowDragging(_: boolean): this;
147
+ dragSingleNeighbors(): boolean;
148
+ dragSingleNeighbors(_: boolean): this;
149
+ layout(): GraphLayoutType;
150
+ layout(_: GraphLayoutType): this;
151
+ applyScaleOnLayout(): boolean;
152
+ applyScaleOnLayout(_: boolean): this;
153
+ highlightOnMouseOverVertex(): boolean;
154
+ highlightOnMouseOverVertex(_: boolean): this;
155
+ highlightOnMouseOverEdge(): boolean;
156
+ highlightOnMouseOverEdge(_: boolean): this;
157
+ transitionDuration(): number;
158
+ transitionDuration(_: number): this;
159
+ highlightSelectedPathToCentroid(): boolean;
160
+ highlightSelectedPathToCentroid(_: boolean): this;
161
+ edgeArcDepth(): number;
162
+ edgeArcDepth(_: number): this;
163
+ minScale(): number;
164
+ minScale(_: number): this;
165
+ maxScale(): number;
166
+ maxScale(_: number): this;
167
+ showEdgeLabels(): boolean;
168
+ showEdgeLabels(_: boolean): this;
169
+ showEdgeLabelsOnHighlight(): boolean;
170
+ showEdgeLabelsOnHighlight(_: boolean): this;
171
+ showVertexLabels(): boolean;
172
+ showVertexLabels(_: boolean): this;
173
+ showVertexLabelsOnHighlight(): boolean;
174
+ showVertexLabelsOnHighlight(_: boolean): this;
175
+ hierarchyRankDirection(): "TB" | "BT" | "LR" | "RL";
176
+ hierarchyRankDirection(_: "TB" | "BT" | "LR" | "RL"): this;
177
+ hierarchyNodeSeparation(): number;
178
+ hierarchyNodeSeparation(_: number): this;
179
+ hierarchyEdgeSeparation(): number;
180
+ hierarchyEdgeSeparation(_: number): this;
181
+ hierarchyRankSeparation(): number;
182
+ hierarchyRankSeparation(_: number): this;
183
+ hierarchyDigraph(): boolean;
184
+ hierarchyDigraph(_: boolean): this;
185
+ forceDirectedAlpha(): number;
186
+ forceDirectedAlpha(_: number): this;
187
+ forceDirectedAlphaMin(): number;
188
+ forceDirectedAlphaMin(_: number): this;
189
+ forceDirectedAlphaDecay(): number;
190
+ forceDirectedAlphaDecay(_: number): this;
191
+ forceDirectedRepulsionStrength(): number;
192
+ forceDirectedRepulsionStrength(_: number): this;
193
+ forceDirectedVelocityDecay(): number;
194
+ forceDirectedVelocityDecay(_: number): this;
195
+ forceDirectedIterations(): number;
196
+ forceDirectedIterations(_: number): this;
197
+ forceDirectedLinkDistance(): number;
198
+ forceDirectedLinkDistance(_: number): this;
199
+ forceDirectedLinkStrength(): number;
200
+ forceDirectedLinkStrength(_: number): this;
201
+ forceDirectedPinCentroid(): boolean;
202
+ forceDirectedPinCentroid(_: boolean): this;
203
+ forceDirectedForceStrength(): number;
204
+ forceDirectedForceStrength(_: number): this;
205
+ forceDirectedMinDistance(): number;
206
+ forceDirectedMinDistance(_: number): this;
207
+ forceDirectedMaxDistance(): number;
208
+ forceDirectedMaxDistance(_: number): this;
209
+ treeRankDirection(): "TB" | "LR";
210
+ treeRankDirection(_: "TB" | "LR"): this;
211
+ edgeColor(): string;
212
+ edgeColor(_: string): this;
213
+ edgeStrokeWidth(): number;
214
+ edgeStrokeWidth(_: number): this;
215
+ tooltipWidth(): number;
216
+ tooltipWidth(_: number): this;
217
+ tooltipHeight(): number;
218
+ tooltipHeight(_: number): this;
219
+ enableTooltipPointerEvents(): boolean;
220
+ enableTooltipPointerEvents(_: boolean): this;
221
+ tooltipCloseDelay(): number;
222
+ tooltipCloseDelay(_: number): this;
223
+ doubleClickMaxDelay(): number;
224
+ doubleClickMaxDelay(_: number): this;
225
+ wasmFolder(): string;
226
+ wasmFolder(_: string): this;
227
+ }
228
+ export declare function graphviz(dot: string, engine?: Engine, _scriptDir?: string): {
229
+ terminate: () => void;
230
+ response: Promise<string>;
231
+ };
232
+ //# sourceMappingURL=graphT.d.ts.map
@@ -1,4 +1,8 @@
1
+ export * from "./graphT";
1
2
  export * from "./graph";
2
3
  export * from "./dataGraph";
3
4
  export * from "./sankeyGraph";
5
+ export * from "./subgraph";
6
+ export * from "./vertex";
7
+ export * from "./edge";
4
8
  //# 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 {
2
+ export interface BaseProps {
4
3
  id: string;
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
13
  }
14
- export interface IEdge extends Edge {
15
- id: string;
16
- source: IVertex;
17
- target: IVertex;
14
+ export interface SubgraphProps extends BaseProps {
15
+ text: string;
16
+ width?: number;
17
+ height?: number;
18
+ }
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 {
34
+ export interface HierarchyBase<SG extends SubgraphProps, V extends VertexProps> {
24
35
  id: string;
25
- parent: ISubgraph;
26
- child: ISubgraph | IVertex;
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 {
45
+ export interface SubgraphPlaceholder<SG extends SubgraphProps = SubgraphProps> {
35
46
  id: string;
36
- element?: Selection<SVGGElement, SubgraphPlaceholder, SVGGElement, any>;
37
- props: ISubgraph;
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 {
52
+ export interface VertexPlaceholder<V extends VertexProps = VertexProps> {
42
53
  id: string;
43
- element?: Selection<SVGGElement, VertexPlaceholder, SVGGElement, any>;
44
- props: IVertex;
45
- centroid?: boolean;
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 {
68
+ export interface EdgePlaceholder<E extends EdgeProps = EdgeProps, V extends VertexProps = VertexProps> {
59
69
  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;
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;
@@ -0,0 +1,12 @@
1
+ import { React } from "@hpcc-js/react";
2
+ import { SubgraphProps } from "./layouts/placeholders";
3
+ export interface BasicSubgraphProps extends SubgraphProps {
4
+ label?: string;
5
+ labelFill?: string;
6
+ labelHeight?: number;
7
+ rectFill?: string;
8
+ rectStroke?: string;
9
+ rectStrokeWidth?: number;
10
+ }
11
+ export declare const BasicSubgraph: React.FunctionComponent<BasicSubgraphProps>;
12
+ //# sourceMappingURL=subgraph.d.ts.map