@hpcc-js/graph 2.86.0 → 3.1.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/dist/index.js +191 -21537
- package/dist/index.js.map +7 -1
- package/package.json +41 -58
- package/src/AdjacencyGraph.ts +3 -3
- package/src/Graph.ts +22 -20
- package/src/GraphData.ts +6 -6
- package/src/GraphLayouts.ts +203 -162
- package/src/Sankey.ts +42 -29
- package/src/Vertex.ts +2 -2
- package/src/__package__.ts +2 -2
- package/src/graph2/dataGraph.ts +109 -69
- package/src/graph2/graph.ts +12 -12
- package/src/graph2/graphReactT.ts +4 -3
- package/src/graph2/graphT.ts +26 -23
- package/src/graph2/index.ts +7 -7
- package/src/graph2/layouts/circle.ts +1 -1
- package/src/graph2/layouts/dagre.ts +3 -3
- package/src/graph2/layouts/dagreWorker.ts +4 -3
- package/src/graph2/layouts/forceDirected.ts +2 -2
- package/src/graph2/layouts/forceDirectedWorker.ts +2 -2
- package/src/graph2/layouts/graphviz.ts +3 -3
- package/src/graph2/layouts/graphvizWorker.ts +1 -1
- package/src/graph2/layouts/index.ts +7 -7
- package/src/graph2/layouts/layout.ts +2 -2
- package/src/graph2/layouts/null.ts +5 -1
- package/src/graph2/layouts/tree.ts +3 -3
- package/src/graph2/liteMap.ts +1 -1
- package/src/graph2/sankeyGraph.ts +85 -56
- package/src/graph2/subgraph.tsx +3 -3
- package/src/graph2/vertex.tsx +4 -4
- package/src/index.ts +8 -8
- package/types/AdjacencyGraph.d.ts +2 -3
- package/types/Edge.d.ts +0 -1
- package/types/Graph.d.ts +10 -10
- package/types/GraphData.d.ts +2 -3
- package/types/GraphLayouts.d.ts +45 -6
- package/types/Sankey.d.ts +27 -46
- package/types/Subgraph.d.ts +0 -1
- package/types/Vertex.d.ts +0 -1
- package/types/__package__.d.ts +2 -3
- package/types/graph2/dataGraph.d.ts +68 -34
- package/types/graph2/graph.d.ts +10 -10
- package/types/graph2/graphReactT.d.ts +3 -3
- package/types/graph2/graphT.d.ts +5 -6
- package/types/graph2/index.d.ts +7 -8
- package/types/graph2/layouts/circle.d.ts +1 -2
- package/types/graph2/layouts/dagre.d.ts +3 -4
- package/types/graph2/layouts/dagreWorker.d.ts +0 -1
- package/types/graph2/layouts/forceDirected.d.ts +2 -3
- package/types/graph2/layouts/forceDirectedWorker.d.ts +0 -1
- package/types/graph2/layouts/geoForceDirected.d.ts +0 -1
- package/types/graph2/layouts/graphviz.d.ts +2 -3
- package/types/graph2/layouts/graphvizWorker.d.ts +0 -1
- package/types/graph2/layouts/index.d.ts +7 -8
- package/types/graph2/layouts/layout.d.ts +2 -3
- package/types/graph2/layouts/null.d.ts +2 -2
- package/types/graph2/layouts/placeholders.d.ts +0 -1
- package/types/graph2/layouts/tree.d.ts +3 -4
- package/types/graph2/sankeyGraph.d.ts +54 -50
- package/types/graph2/subgraph.d.ts +2 -3
- package/types/graph2/vertex.d.ts +2 -3
- package/types/index.d.ts +8 -9
- package/dist/index.es6.js +0 -21516
- package/dist/index.es6.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- package/types/AdjacencyGraph.d.ts.map +0 -1
- package/types/Edge.d.ts.map +0 -1
- package/types/Graph.d.ts.map +0 -1
- package/types/GraphData.d.ts.map +0 -1
- package/types/GraphLayouts.d.ts.map +0 -1
- package/types/Sankey.d.ts.map +0 -1
- package/types/Subgraph.d.ts.map +0 -1
- package/types/Vertex.d.ts.map +0 -1
- package/types/__package__.d.ts.map +0 -1
- package/types/__tests__/data.d.ts +0 -9
- package/types/__tests__/data.d.ts.map +0 -1
- package/types/__tests__/index.d.ts +0 -2
- package/types/__tests__/index.d.ts.map +0 -1
- package/types/__tests__/test1.d.ts +0 -5
- package/types/__tests__/test1.d.ts.map +0 -1
- package/types/__tests__/test2.d.ts +0 -5
- package/types/__tests__/test2.d.ts.map +0 -1
- package/types/__tests__/test3.d.ts +0 -5
- package/types/__tests__/test3.d.ts.map +0 -1
- package/types/__tests__/test4.d.ts +0 -5
- package/types/__tests__/test4.d.ts.map +0 -1
- package/types/__tests__/test5.d.ts +0 -30
- package/types/__tests__/test5.d.ts.map +0 -1
- package/types/graph2/dataGraph.d.ts.map +0 -1
- package/types/graph2/graph.d.ts.map +0 -1
- package/types/graph2/graphReactT.d.ts.map +0 -1
- package/types/graph2/graphT.d.ts.map +0 -1
- package/types/graph2/index.d.ts.map +0 -1
- package/types/graph2/layouts/circle.d.ts.map +0 -1
- package/types/graph2/layouts/dagre.d.ts.map +0 -1
- package/types/graph2/layouts/dagreWorker.d.ts.map +0 -1
- package/types/graph2/layouts/forceDirected.d.ts.map +0 -1
- package/types/graph2/layouts/forceDirectedWorker.d.ts.map +0 -1
- package/types/graph2/layouts/geoForceDirected.d.ts.map +0 -1
- package/types/graph2/layouts/graphviz.d.ts.map +0 -1
- package/types/graph2/layouts/graphvizWorker.d.ts.map +0 -1
- package/types/graph2/layouts/index.d.ts.map +0 -1
- package/types/graph2/layouts/layout.d.ts.map +0 -1
- package/types/graph2/layouts/null.d.ts.map +0 -1
- package/types/graph2/layouts/placeholders.d.ts.map +0 -1
- package/types/graph2/layouts/tree.d.ts.map +0 -1
- package/types/graph2/liteMap.d.ts +0 -13
- package/types/graph2/liteMap.d.ts.map +0 -1
- package/types/graph2/liteSVGZooom.d.ts +0 -16
- package/types/graph2/liteSVGZooom.d.ts.map +0 -1
- package/types/graph2/sankeyGraph.d.ts.map +0 -1
- package/types/graph2/subgraph.d.ts.map +0 -1
- package/types/graph2/vertex.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/test.d.ts +0 -17
- package/types/test.d.ts.map +0 -1
- package/types-3.4/AdjacencyGraph.d.ts +0 -69
- package/types-3.4/Edge.d.ts +0 -60
- package/types-3.4/Graph.d.ts +0 -159
- package/types-3.4/GraphData.d.ts +0 -33
- package/types-3.4/GraphLayouts.d.ts +0 -6
- package/types-3.4/Sankey.d.ts +0 -72
- package/types-3.4/Subgraph.d.ts +0 -45
- package/types-3.4/Vertex.d.ts +0 -83
- package/types-3.4/__package__.d.ts +0 -4
- package/types-3.4/__tests__/data.d.ts +0 -9
- package/types-3.4/__tests__/index.d.ts +0 -2
- package/types-3.4/__tests__/test1.d.ts +0 -5
- package/types-3.4/__tests__/test2.d.ts +0 -5
- package/types-3.4/__tests__/test3.d.ts +0 -5
- package/types-3.4/__tests__/test4.d.ts +0 -5
- package/types-3.4/__tests__/test5.d.ts +0 -30
- package/types-3.4/graph2/dataGraph.d.ts +0 -66
- package/types-3.4/graph2/graph.d.ts +0 -55
- package/types-3.4/graph2/graphReactT.d.ts +0 -15
- package/types-3.4/graph2/graphT.d.ts +0 -234
- package/types-3.4/graph2/index.d.ts +0 -8
- package/types-3.4/graph2/layouts/circle.d.ts +0 -7
- package/types-3.4/graph2/layouts/dagre.d.ts +0 -13
- package/types-3.4/graph2/layouts/dagreWorker.d.ts +0 -35
- package/types-3.4/graph2/layouts/forceDirected.d.ts +0 -19
- package/types-3.4/graph2/layouts/forceDirectedWorker.d.ts +0 -32
- package/types-3.4/graph2/layouts/geoForceDirected.d.ts +0 -2
- package/types-3.4/graph2/layouts/graphviz.d.ts +0 -15
- package/types-3.4/graph2/layouts/graphvizWorker.d.ts +0 -59
- package/types-3.4/graph2/layouts/index.d.ts +0 -8
- package/types-3.4/graph2/layouts/layout.d.ts +0 -43
- package/types-3.4/graph2/layouts/null.d.ts +0 -8
- package/types-3.4/graph2/layouts/placeholders.d.ts +0 -83
- package/types-3.4/graph2/layouts/tree.d.ts +0 -51
- package/types-3.4/graph2/liteMap.d.ts +0 -16
- package/types-3.4/graph2/liteSVGZooom.d.ts +0 -16
- package/types-3.4/graph2/sankeyGraph.d.ts +0 -73
- package/types-3.4/graph2/subgraph.d.ts +0 -12
- package/types-3.4/graph2/vertex.d.ts +0 -13
- package/types-3.4/index.d.ts +0 -9
- package/types-3.4/test.d.ts +0 -17
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./circle";
|
|
2
|
-
export * from "./dagre";
|
|
3
|
-
export * from "./forceDirected";
|
|
4
|
-
export * from "./geoForceDirected";
|
|
5
|
-
export * from "./graphviz";
|
|
6
|
-
export type { ILayout } from "./layout";
|
|
7
|
-
export * from "./null";
|
|
1
|
+
export * from "./circle.ts";
|
|
2
|
+
export * from "./dagre.ts";
|
|
3
|
+
export * from "./forceDirected.ts";
|
|
4
|
+
export * from "./geoForceDirected.ts";
|
|
5
|
+
export * from "./graphviz.ts";
|
|
6
|
+
export type { ILayout } from "./layout.ts";
|
|
7
|
+
export * from "./null.ts";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Graph2 as GraphCollection } from "@hpcc-js/util";
|
|
2
2
|
import { curveBasis as d3CurveBasis, curveCardinal as d3CurveCardinal, line as d3Line } from "d3-shape";
|
|
3
|
-
import { EdgePlaceholder, SubgraphPlaceholder, VertexPlaceholder } from "./placeholders";
|
|
4
|
-
import { EdgeLayout } from "./tree";
|
|
3
|
+
import { EdgePlaceholder, SubgraphPlaceholder, VertexPlaceholder } from "./placeholders.ts";
|
|
4
|
+
import { EdgeLayout } from "./tree.ts";
|
|
5
5
|
|
|
6
6
|
export type Point = [number, number];
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Graph2 } from "@hpcc-js/util";
|
|
2
2
|
import { cluster, hierarchy, tree } from "d3-hierarchy";
|
|
3
3
|
import { linkHorizontal as d3LinkHorizontal } from "d3-shape";
|
|
4
|
-
import { Hierarchy } from "./dagreWorker";
|
|
5
|
-
import { Layout, Point } from "./layout";
|
|
6
|
-
import { VertexPlaceholder, EdgePlaceholder, SubgraphPlaceholder } from "./placeholders";
|
|
4
|
+
import { Hierarchy } from "./dagreWorker.ts";
|
|
5
|
+
import { Layout, Point } from "./layout.ts";
|
|
6
|
+
import { VertexPlaceholder, EdgePlaceholder, SubgraphPlaceholder } from "./placeholders.ts";
|
|
7
7
|
|
|
8
8
|
const linkHorizontal = d3LinkHorizontal<any, { x: number, y: number }>()
|
|
9
9
|
.x(d => d.x)
|
package/src/graph2/liteMap.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { select as d3Select, zoomTransform as d3ZoomTransform } from "@hpcc-js/common";
|
|
2
2
|
import { geoMercator as d3GeoMercator } from "d3-geo";
|
|
3
3
|
import { tile as d3Tile, tileWrap as d3TileWrap } from "d3-tile";
|
|
4
|
-
import { LiteSVGZoomWidget } from "./liteSVGZooom";
|
|
4
|
+
import { LiteSVGZoomWidget } from "./liteSVGZooom.ts";
|
|
5
5
|
|
|
6
6
|
function url(x, y, z) {
|
|
7
7
|
return `https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/${z}/${x}/${y}${devicePixelRatio > 1 ? "@2x" : ""}?access_token=pk.eyJ1IjoibGVzY2htb28iLCJhIjoiY2psY2FqY3l3MDhqNDN3cDl1MzFmZnkwcCJ9.HRoFwmz1j80gyz18ruggqw`;
|
|
@@ -1,56 +1,19 @@
|
|
|
1
|
-
import { Palette,
|
|
1
|
+
import { Palette, SVGWidget, Utility, select as d3Select } from "@hpcc-js/common";
|
|
2
2
|
import { compare2 } from "@hpcc-js/util";
|
|
3
3
|
import { sankey as d3Sankey, sankeyLinkHorizontal as d3SankeyLinkHorizontal } from "d3-sankey";
|
|
4
|
-
import {
|
|
5
|
-
import { AnnotationColumn, toJsonObj } from "./dataGraph";
|
|
4
|
+
import { AnnotationColumn, toJsonObj } from "./dataGraph.ts";
|
|
6
5
|
|
|
7
6
|
import "../../src/graph2/sankeyGraph.css";
|
|
8
|
-
import { EdgeBaseProps, VertexBaseProps } from "./graphT";
|
|
7
|
+
import { EdgeBaseProps, VertexBaseProps } from "./graphT.ts";
|
|
9
8
|
|
|
10
9
|
export class SankeyGraph extends SVGWidget {
|
|
11
|
-
@publish([], "any", "Vertex Columns", null, { internal: true })
|
|
12
|
-
vertexColumns: publish<this, string[]>;
|
|
13
|
-
@publish([], "any", "Vertices (Nodes)", null, { internal: true })
|
|
14
|
-
vertices: publish<this, Array<Array<string | number | boolean>>>;
|
|
15
|
-
@publish("", "set", "Vertex Category ID column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true })
|
|
16
|
-
vertexCategoryColumn: publish<this, string>;
|
|
17
|
-
@publish("", "set", "Vertex ID column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true })
|
|
18
|
-
vertexIDColumn: publish<this, string>;
|
|
19
|
-
@publish("", "set", "Vertex label column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true })
|
|
20
|
-
vertexLabelColumn: publish<this, string>;
|
|
21
|
-
@publish("", "set", "Vertex centroid column (boolean)", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true })
|
|
22
|
-
vertexCentroidColumn: publish<this, string>;
|
|
23
|
-
@publish("?", "string", "Vertex default FAChar")
|
|
24
|
-
vertexFAChar: publish<this, string>;
|
|
25
|
-
@publish("", "set", "Vertex FAChar column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true })
|
|
26
|
-
vertexFACharColumn: publish<this, string>;
|
|
27
|
-
@publish("", "set", "Vertex tooltip column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true })
|
|
28
|
-
vertexTooltipColumn: publish<this, string>;
|
|
29
|
-
@publish([], "propertyArray", "Annotations", null, { autoExpand: AnnotationColumn })
|
|
30
|
-
vertexAnnotationColumns: publish<this, AnnotationColumn[]>;
|
|
31
|
-
|
|
32
|
-
@publish([], "any", "Edge columns", null, { internal: true })
|
|
33
|
-
edgeColumns: publish<this, string[]>;
|
|
34
|
-
@publish([], "any", "Edges (Edges)", null, { internal: true })
|
|
35
|
-
edges: publish<this, Array<Array<string | number | boolean>>>;
|
|
36
|
-
@publish("", "set", "Edge ID column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true })
|
|
37
|
-
edgeIDColumn: publish<this, string>;
|
|
38
|
-
@publish("", "set", "Edge label column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true })
|
|
39
|
-
edgeLabelColumn: publish<this, string>;
|
|
40
|
-
@publish("", "set", "Edge source ID column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true })
|
|
41
|
-
edgeSourceColumn: publish<this, string>;
|
|
42
|
-
@publish("", "set", "Edge target ID column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true })
|
|
43
|
-
edgeTargetColumn: publish<this, string>;
|
|
44
|
-
@publish("", "set", "Edge target ID column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true })
|
|
45
|
-
edgeWeightColumn: publish<this, string>;
|
|
46
10
|
|
|
47
11
|
protected _d3Sankey: any;
|
|
48
12
|
protected _selection: any;
|
|
49
|
-
_palette: any;
|
|
50
13
|
|
|
51
14
|
constructor() {
|
|
52
15
|
super();
|
|
53
|
-
Utility.SimpleSelectionMixin.call(this);
|
|
16
|
+
Utility.SimpleSelectionMixin.call(this, false);
|
|
54
17
|
|
|
55
18
|
this._drawStartPos = "origin";
|
|
56
19
|
}
|
|
@@ -174,7 +137,7 @@ export class SankeyGraph extends SVGWidget {
|
|
|
174
137
|
const link = element.selectAll(".link").data(sankeyData.edges);
|
|
175
138
|
link.enter().append("path")
|
|
176
139
|
.attr("class", "link")
|
|
177
|
-
.each(function () {
|
|
140
|
+
.each(function (this: HTMLElement) {
|
|
178
141
|
d3Select(this)
|
|
179
142
|
.append("title")
|
|
180
143
|
;
|
|
@@ -195,13 +158,13 @@ export class SankeyGraph extends SVGWidget {
|
|
|
195
158
|
node.enter().append("g")
|
|
196
159
|
.attr("class", "node")
|
|
197
160
|
.call(this._selection.enter.bind(this._selection))
|
|
198
|
-
.on("click", function (d) {
|
|
161
|
+
.on("click", function (this: HTMLElement, d) {
|
|
199
162
|
context.click(d.origData, "", context._selection.selected(this));
|
|
200
163
|
})
|
|
201
|
-
.on("dblclick", function (d) {
|
|
164
|
+
.on("dblclick", function (this: HTMLElement, d) {
|
|
202
165
|
context.dblclick(d.origData, "", context._selection.selected(this));
|
|
203
166
|
})
|
|
204
|
-
.each(function () {
|
|
167
|
+
.each(function (this: HTMLElement) {
|
|
205
168
|
const gElement = d3Select(this);
|
|
206
169
|
gElement.append("rect");
|
|
207
170
|
gElement.append("text");
|
|
@@ -223,7 +186,7 @@ export class SankeyGraph extends SVGWidget {
|
|
|
223
186
|
if (d.y0) _y = d.y0;
|
|
224
187
|
return "translate(" + (_x + strokeWidth) + "," + (_y + strokeWidth) + ")";
|
|
225
188
|
})
|
|
226
|
-
.each(function () {
|
|
189
|
+
.each(function (this: HTMLElement) {
|
|
227
190
|
const n = d3Select(this);
|
|
228
191
|
n.select("rect")
|
|
229
192
|
.attr("height", (d: any) => {
|
|
@@ -283,14 +246,6 @@ export class SankeyGraph extends SVGWidget {
|
|
|
283
246
|
*/
|
|
284
247
|
}
|
|
285
248
|
|
|
286
|
-
paletteID: { (): string; (_: string): SankeyGraph; };
|
|
287
|
-
vertexStrokeWidth: { (): number; (_: number): SankeyGraph; };
|
|
288
|
-
vertexStrokeColor: { (): string; (_: string): SankeyGraph; };
|
|
289
|
-
vertexWidth: { (): number; (_: number): SankeyGraph; };
|
|
290
|
-
vertexPadding: { (): number; (_: number): SankeyGraph; };
|
|
291
|
-
xAxisMovement: { (): boolean; (_: boolean): SankeyGraph; };
|
|
292
|
-
yAxisMovement: { (): boolean; (_: boolean): SankeyGraph; };
|
|
293
|
-
|
|
294
249
|
exit(domNode, element) {
|
|
295
250
|
super.exit(domNode, element);
|
|
296
251
|
}
|
|
@@ -307,10 +262,84 @@ SankeyGraph.prototype.mixin(Utility.SimpleSelectionMixin);
|
|
|
307
262
|
|
|
308
263
|
SankeyGraph.prototype._palette = Palette.ordinal("category10");
|
|
309
264
|
|
|
265
|
+
export interface SankeyGraph {
|
|
266
|
+
_palette: any;
|
|
267
|
+
vertexColumns(): string[];
|
|
268
|
+
vertexColumns(_: string[]): this;
|
|
269
|
+
vertices(): Array<Array<string | number | boolean>>;
|
|
270
|
+
vertices(_: Array<Array<string | number | boolean>>): this;
|
|
271
|
+
vertexCategoryColumn(): string;
|
|
272
|
+
vertexCategoryColumn(_: string): this;
|
|
273
|
+
vertexIDColumn(): string;
|
|
274
|
+
vertexIDColumn(_: string): this;
|
|
275
|
+
vertexLabelColumn(): string;
|
|
276
|
+
vertexLabelColumn(_: string): this;
|
|
277
|
+
vertexCentroidColumn(): string;
|
|
278
|
+
vertexCentroidColumn(_: string): this;
|
|
279
|
+
vertexFAChar(): string;
|
|
280
|
+
vertexFAChar(_: string): this;
|
|
281
|
+
vertexFACharColumn(): string;
|
|
282
|
+
vertexFACharColumn(_: string): this;
|
|
283
|
+
vertexTooltipColumn(): string;
|
|
284
|
+
vertexTooltipColumn(_: string): this;
|
|
285
|
+
vertexAnnotationColumns(): AnnotationColumn[];
|
|
286
|
+
vertexAnnotationColumns(_: AnnotationColumn[]): this;
|
|
287
|
+
|
|
288
|
+
edgeColumns(): string[];
|
|
289
|
+
edgeColumns(_: string[]): this;
|
|
290
|
+
edges(): Array<Array<string | number | boolean>>;
|
|
291
|
+
edges(_: Array<Array<string | number | boolean>>): this;
|
|
292
|
+
edgeIDColumn(): string;
|
|
293
|
+
edgeIDColumn(_: string): this;
|
|
294
|
+
edgeLabelColumn(): string;
|
|
295
|
+
edgeLabelColumn(_: string): this;
|
|
296
|
+
edgeSourceColumn(): string;
|
|
297
|
+
edgeSourceColumn(_: string): this;
|
|
298
|
+
edgeTargetColumn(): string;
|
|
299
|
+
edgeTargetColumn(_: string): this;
|
|
300
|
+
edgeWeightColumn(): string;
|
|
301
|
+
edgeWeightColumn(_: string): this;
|
|
302
|
+
|
|
303
|
+
paletteID(): string;
|
|
304
|
+
paletteID(_: string): this;
|
|
305
|
+
vertexStrokeWidth(): number;
|
|
306
|
+
vertexStrokeWidth(_: number): this;
|
|
307
|
+
vertexStrokeColor(): string;
|
|
308
|
+
vertexStrokeColor(_: string): this;
|
|
309
|
+
vertexWidth(): number;
|
|
310
|
+
vertexWidth(_: number): this;
|
|
311
|
+
vertexPadding(): number;
|
|
312
|
+
vertexPadding(_: number): this;
|
|
313
|
+
xAxisMovement(): boolean;
|
|
314
|
+
xAxisMovement(_: boolean): this;
|
|
315
|
+
yAxisMovement(): boolean;
|
|
316
|
+
yAxisMovement(_: boolean): this;
|
|
317
|
+
}
|
|
318
|
+
|
|
310
319
|
SankeyGraph.prototype.publish("paletteID", "category10", "set", "Color palette for this widget", SankeyGraph.prototype._palette.switch());
|
|
320
|
+
|
|
321
|
+
SankeyGraph.prototype.publish("xAxisMovement", false, "boolean", "Enable x-axis movement");
|
|
322
|
+
SankeyGraph.prototype.publish("yAxisMovement", false, "boolean", "Enable y-axis movement");
|
|
323
|
+
|
|
311
324
|
SankeyGraph.prototype.publish("vertexStrokeWidth", 1, "number", "Vertex Stroke Width");
|
|
312
325
|
SankeyGraph.prototype.publish("vertexStrokeColor", "darkgray", "string", "Vertex Stroke Color");
|
|
313
326
|
SankeyGraph.prototype.publish("vertexWidth", 36, "number", "Vertex Width");
|
|
314
327
|
SankeyGraph.prototype.publish("vertexPadding", 20, "number", "Vertex Padding");
|
|
315
|
-
SankeyGraph.prototype.publish("
|
|
316
|
-
SankeyGraph.prototype.publish("
|
|
328
|
+
SankeyGraph.prototype.publish("vertexColumns", [], "any", "Vertex Columns", null, { internal: true });
|
|
329
|
+
SankeyGraph.prototype.publish("vertices", [], "any", "Vertices (Nodes)", null, { internal: true });
|
|
330
|
+
SankeyGraph.prototype.publish("vertexCategoryColumn", "", "set", "Vertex Category ID column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true });
|
|
331
|
+
SankeyGraph.prototype.publish("vertexIDColumn", "", "set", "Vertex ID column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true });
|
|
332
|
+
SankeyGraph.prototype.publish("vertexLabelColumn", "", "set", "Vertex label column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true });
|
|
333
|
+
SankeyGraph.prototype.publish("vertexCentroidColumn", "", "set", "Vertex centroid column (boolean)", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true });
|
|
334
|
+
SankeyGraph.prototype.publish("vertexFAChar", "?", "string", "Vertex default FAChar");
|
|
335
|
+
SankeyGraph.prototype.publish("vertexFACharColumn", "", "set", "Vertex FAChar column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true });
|
|
336
|
+
SankeyGraph.prototype.publish("vertexTooltipColumn", "", "set", "Vertex tooltip column", function (this: SankeyGraph) { return this.vertexColumns(); }, { optional: true });
|
|
337
|
+
SankeyGraph.prototype.publish("vertexAnnotationColumns", [], "propertyArray", "Annotations", null, { autoExpand: AnnotationColumn });
|
|
338
|
+
|
|
339
|
+
SankeyGraph.prototype.publish("edgeColumns", [], "any", "Edge columns", null, { internal: true });
|
|
340
|
+
SankeyGraph.prototype.publish("edges", [], "any", "Edges (Edges)", null, { internal: true });
|
|
341
|
+
SankeyGraph.prototype.publish("edgeIDColumn", "", "set", "Edge ID column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true });
|
|
342
|
+
SankeyGraph.prototype.publish("edgeLabelColumn", "", "set", "Edge label column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true });
|
|
343
|
+
SankeyGraph.prototype.publish("edgeSourceColumn", "", "set", "Edge source ID column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true });
|
|
344
|
+
SankeyGraph.prototype.publish("edgeTargetColumn", "", "set", "Edge target ID column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true });
|
|
345
|
+
SankeyGraph.prototype.publish("edgeWeightColumn", "", "set", "Edge weight column", function (this: SankeyGraph) { return this.edgeColumns(); }, { optional: true });
|
package/src/graph2/subgraph.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { SubgraphBaseProps } from "./layouts/placeholders";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text } from "@hpcc-js/react";
|
|
3
|
+
import { SubgraphBaseProps } from "./layouts/placeholders.ts";
|
|
4
4
|
|
|
5
5
|
export interface BasicSubgraphProps extends SubgraphBaseProps {
|
|
6
6
|
label?: string;
|
package/src/graph2/vertex.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { VertexBaseProps } from "./layouts/placeholders";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text } from "@hpcc-js/react";
|
|
3
|
+
import { VertexBaseProps } from "./layouts/placeholders.ts";
|
|
4
4
|
|
|
5
5
|
export interface BasicVertexProps extends VertexBaseProps {
|
|
6
6
|
textFill?: string;
|
|
@@ -25,7 +25,7 @@ export const BasicVertex: React.FunctionComponent<BasicVertexProps> = ({
|
|
|
25
25
|
return <g transform={`scale(${scale})`}>
|
|
26
26
|
<circle cx="0" cy="0" r={circleRadius} fill={circleFill} stroke={circleStroke} style={{ strokeWidth: circleStrokeWidth }} />
|
|
27
27
|
<g transform={`translate(0 ${circleRadius + textHeight})`}>
|
|
28
|
-
<Text text={text} fill={textFill} height={textHeight}
|
|
28
|
+
<Text text={text} fill={textFill} height={textHeight} />
|
|
29
29
|
</g>
|
|
30
30
|
</g>;
|
|
31
31
|
};
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./__package__";
|
|
2
|
-
export * from "./AdjacencyGraph";
|
|
3
|
-
export * from "./Edge";
|
|
4
|
-
export * from "./Graph";
|
|
5
|
-
export * from "./Sankey";
|
|
6
|
-
export * from "./Subgraph";
|
|
7
|
-
export * from "./Vertex";
|
|
8
|
-
export * from "./graph2/index";
|
|
1
|
+
export * from "./__package__.ts";
|
|
2
|
+
export * from "./AdjacencyGraph.ts";
|
|
3
|
+
export * from "./Edge.ts";
|
|
4
|
+
export * from "./Graph.ts";
|
|
5
|
+
export * from "./Sankey.ts";
|
|
6
|
+
export * from "./Subgraph.ts";
|
|
7
|
+
export * from "./Vertex.ts";
|
|
8
|
+
export * from "./graph2/index.ts";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropertyExt } from "@hpcc-js/common";
|
|
2
|
-
import { Graph, IGraphData } from "./Graph";
|
|
3
|
-
import { IAnnotation } from "./Vertex";
|
|
2
|
+
import { Graph, IGraphData } from "./Graph.ts";
|
|
3
|
+
import { IAnnotation } from "./Vertex.ts";
|
|
4
4
|
interface IAnnotationIndexes {
|
|
5
5
|
iconCol: number;
|
|
6
6
|
iconFillCol: number;
|
|
@@ -66,4 +66,3 @@ export interface AdjacencyGraph {
|
|
|
66
66
|
annotations(_: Annotation[]): this;
|
|
67
67
|
}
|
|
68
68
|
export {};
|
|
69
|
-
//# sourceMappingURL=AdjacencyGraph.d.ts.map
|
package/types/Edge.d.ts
CHANGED
package/types/Graph.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ISize, SVGGlowFilter, SVGZoomWidget, Widget } from "@hpcc-js/common";
|
|
2
2
|
import "d3-transition";
|
|
3
|
-
import { Edge } from "./Edge";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import { Edge } from "./Edge.ts";
|
|
4
|
+
import * as GraphLayouts from "./GraphLayouts.ts";
|
|
5
|
+
import { Subgraph } from "./Subgraph.ts";
|
|
6
|
+
import { Vertex } from "./Vertex.ts";
|
|
6
7
|
import "../src/Graph.css";
|
|
7
8
|
export interface Lineage {
|
|
8
9
|
parent: Widget;
|
|
@@ -77,7 +78,7 @@ export declare class Graph extends SVGZoomWidget {
|
|
|
77
78
|
_prevDataHash: any;
|
|
78
79
|
doLayout(transitionDuration?: number): Promise<void>;
|
|
79
80
|
_doLayout(transitionDuration?: number): Promise<void>;
|
|
80
|
-
getLayoutEngine():
|
|
81
|
+
getLayoutEngine(): GraphLayouts.Circle | GraphLayouts.ForceDirected | GraphLayouts.Hierarchy;
|
|
81
82
|
getNeighborMap(vertex: any): {
|
|
82
83
|
vertices: {};
|
|
83
84
|
edges: {};
|
|
@@ -99,11 +100,6 @@ export declare class Graph extends SVGZoomWidget {
|
|
|
99
100
|
edge_mouseover(element: any, d: any): void;
|
|
100
101
|
edge_mouseout(_element: any, _d: any): void;
|
|
101
102
|
addMarkers(clearFirst?: boolean): void;
|
|
102
|
-
edge_click: (_row: any, _col: any, _sel: any, _more: any) => void;
|
|
103
|
-
edge_dblclick: (_row: any, _col: any, _sel: any, _more: any) => void;
|
|
104
|
-
tooltip: any;
|
|
105
|
-
tooltipHTML: (_: any) => string;
|
|
106
|
-
tooltipFormat: (_: any) => string;
|
|
107
103
|
progress(what: "start" | "end" | "layout-start" | "layout-tick" | "layout-end"): void;
|
|
108
104
|
}
|
|
109
105
|
export interface Graph {
|
|
@@ -155,5 +151,9 @@ export interface Graph {
|
|
|
155
151
|
forceDirectedTheta(_: number): this;
|
|
156
152
|
forceDirectedGravity(): number;
|
|
157
153
|
forceDirectedGravity(_: number): this;
|
|
154
|
+
edge_click(_row: any, _col: any, _sel: any, _more: any): void;
|
|
155
|
+
edge_dblclick(_row: any, _col: any, _sel: any, _more: any): void;
|
|
156
|
+
tooltip: any;
|
|
157
|
+
tooltipHTML(_: any): string;
|
|
158
|
+
tooltipFormat(_: any): string;
|
|
158
159
|
}
|
|
159
|
-
//# sourceMappingURL=Graph.d.ts.map
|
package/types/GraphData.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Edge as GLEdge, GraphEdge, Node } from "dagre";
|
|
2
|
-
import { Vertex } from "./Vertex";
|
|
1
|
+
import { Edge as GLEdge, GraphEdge, Node } from "@dagrejs/dagre";
|
|
2
|
+
import { Vertex } from "./Vertex.ts";
|
|
3
3
|
type GLNode = Node<Vertex>;
|
|
4
4
|
export interface GraphLabel {
|
|
5
5
|
debugTiming?: boolean;
|
|
@@ -30,4 +30,3 @@ export declare class GraphData {
|
|
|
30
30
|
getJSON(): string;
|
|
31
31
|
}
|
|
32
32
|
export {};
|
|
33
|
-
//# sourceMappingURL=GraphData.d.ts.map
|
package/types/GraphLayouts.d.ts
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
|
-
import { GraphData } from "./GraphData";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { GraphData } from "./GraphData.ts";
|
|
2
|
+
interface Pos {
|
|
3
|
+
x?: number;
|
|
4
|
+
y?: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class Circle {
|
|
9
|
+
protected pos: {
|
|
10
|
+
[id: string]: Pos;
|
|
11
|
+
};
|
|
12
|
+
constructor(graphData: GraphData, width?: any, height?: any, radius?: any);
|
|
13
|
+
nodePos(u: any): Pos;
|
|
14
|
+
edgePoints(_e: any): any[];
|
|
15
|
+
}
|
|
16
|
+
export declare class None {
|
|
17
|
+
protected pos: {
|
|
18
|
+
[id: string]: Pos;
|
|
19
|
+
};
|
|
20
|
+
constructor(graphData: GraphData, _width: any, _height: any, _radius: any);
|
|
21
|
+
nodePos(u: any): Pos;
|
|
22
|
+
edgePoints(_e: any): any[];
|
|
23
|
+
}
|
|
24
|
+
export declare class ForceDirected {
|
|
25
|
+
protected pos: {
|
|
26
|
+
[id: string]: Pos;
|
|
27
|
+
};
|
|
28
|
+
vertices: any[];
|
|
29
|
+
protected vertexMap: {
|
|
30
|
+
[id: string]: any;
|
|
31
|
+
};
|
|
32
|
+
protected edges: any[];
|
|
33
|
+
protected force: any;
|
|
34
|
+
constructor(graphData: GraphData, width: any, height: any, options: any);
|
|
35
|
+
nodePos(u: any): any;
|
|
36
|
+
edgePoints(_e: any): any[];
|
|
37
|
+
}
|
|
38
|
+
export declare class Hierarchy {
|
|
39
|
+
protected digraph: any;
|
|
40
|
+
protected dagreLayout: any;
|
|
41
|
+
constructor(graphData: GraphData, _width: any, _height: any, options: any);
|
|
42
|
+
nodePos(u: any): any;
|
|
43
|
+
edgePoints(edge: any): any;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
package/types/Sankey.d.ts
CHANGED
|
@@ -7,22 +7,17 @@ export declare class SankeyColumn extends PropertyExt {
|
|
|
7
7
|
owner(_: Sankey): this;
|
|
8
8
|
valid(): boolean;
|
|
9
9
|
aggregate(values: any): any;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
aggrType:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
aggrColumn: {
|
|
19
|
-
(): string;
|
|
20
|
-
(_: string): SankeyColumn;
|
|
21
|
-
};
|
|
10
|
+
}
|
|
11
|
+
export interface SankeyColumn {
|
|
12
|
+
column(): string;
|
|
13
|
+
column(_: string): this;
|
|
14
|
+
aggrType(): string;
|
|
15
|
+
aggrType(_: string): this;
|
|
16
|
+
aggrColumn(): string;
|
|
17
|
+
aggrColumn(_: string): this;
|
|
22
18
|
}
|
|
23
19
|
export declare class Sankey extends SVGWidget {
|
|
24
20
|
Column: any;
|
|
25
|
-
_palette: any;
|
|
26
21
|
_d3Sankey: any;
|
|
27
22
|
_d3SankeyPath: any;
|
|
28
23
|
_selection: any;
|
|
@@ -33,40 +28,26 @@ export declare class Sankey extends SVGWidget {
|
|
|
33
28
|
};
|
|
34
29
|
enter(domNode: any, element: any): void;
|
|
35
30
|
update(domNode: any, element: any): void;
|
|
36
|
-
paletteID: {
|
|
37
|
-
(): string;
|
|
38
|
-
(_: string): Sankey;
|
|
39
|
-
};
|
|
40
|
-
mappings: {
|
|
41
|
-
(): SankeyColumn[];
|
|
42
|
-
(_: SankeyColumn[]): Sankey;
|
|
43
|
-
};
|
|
44
|
-
vertexStrokeWidth: {
|
|
45
|
-
(): number;
|
|
46
|
-
(_: number): Sankey;
|
|
47
|
-
};
|
|
48
|
-
vertexStrokeColor: {
|
|
49
|
-
(): string;
|
|
50
|
-
(_: string): Sankey;
|
|
51
|
-
};
|
|
52
|
-
vertexWidth: {
|
|
53
|
-
(): number;
|
|
54
|
-
(_: number): Sankey;
|
|
55
|
-
};
|
|
56
|
-
vertexPadding: {
|
|
57
|
-
(): number;
|
|
58
|
-
(_: number): Sankey;
|
|
59
|
-
};
|
|
60
|
-
xAxisMovement: {
|
|
61
|
-
(): boolean;
|
|
62
|
-
(_: boolean): Sankey;
|
|
63
|
-
};
|
|
64
|
-
yAxisMovement: {
|
|
65
|
-
(): boolean;
|
|
66
|
-
(_: boolean): Sankey;
|
|
67
|
-
};
|
|
68
31
|
exit(domNode: any, element: any): void;
|
|
69
32
|
click(row: any, column: any, selected: any): void;
|
|
70
33
|
dblclick(row: any, column: any, selected: any): void;
|
|
71
34
|
}
|
|
72
|
-
|
|
35
|
+
export interface Sankey {
|
|
36
|
+
_palette: any;
|
|
37
|
+
paletteID(): string;
|
|
38
|
+
paletteID(_: string): this;
|
|
39
|
+
mappings(): SankeyColumn[];
|
|
40
|
+
mappings(_: SankeyColumn[]): this;
|
|
41
|
+
vertexStrokeWidth(): number;
|
|
42
|
+
vertexStrokeWidth(_: number): this;
|
|
43
|
+
vertexStrokeColor(): string;
|
|
44
|
+
vertexStrokeColor(_: string): this;
|
|
45
|
+
vertexWidth(): number;
|
|
46
|
+
vertexWidth(_: number): this;
|
|
47
|
+
vertexPadding(): number;
|
|
48
|
+
vertexPadding(_: number): this;
|
|
49
|
+
xAxisMovement(): boolean;
|
|
50
|
+
xAxisMovement(_: boolean): this;
|
|
51
|
+
yAxisMovement(): boolean;
|
|
52
|
+
yAxisMovement(_: boolean): this;
|
|
53
|
+
}
|
package/types/Subgraph.d.ts
CHANGED
package/types/Vertex.d.ts
CHANGED
package/types/__package__.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/graph";
|
|
2
|
-
export declare const PKG_VERSION = "
|
|
3
|
-
export declare const BUILD_VERSION = "2.
|
|
4
|
-
//# sourceMappingURL=__package__.d.ts.map
|
|
2
|
+
export declare const PKG_VERSION = "3.1.0";
|
|
3
|
+
export declare const BUILD_VERSION = "3.2.0";
|