@hpcc-js/graph 2.84.2 → 2.84.3
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.es6.js +19 -9
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +19 -9
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +8 -9
- package/src/__package__.ts +2 -2
- package/src/__tests__/test5.ts +8 -4
- package/src/graph2/graphT.ts +14 -4
- package/src/graph2/layouts/graphviz.ts +1 -2
- package/src/graph2/layouts/graphvizWorker.ts +1 -9
- package/types/__package__.d.ts +2 -2
- package/types/__tests__/test5.d.ts +25 -0
- package/types/__tests__/test5.d.ts.map +1 -1
- package/types/graph2/graphT.d.ts +1 -0
- package/types/graph2/graphT.d.ts.map +1 -1
- package/types/graph2/layouts/graphviz.d.ts.map +1 -1
- package/types/graph2/layouts/graphvizWorker.d.ts +0 -1
- package/types/graph2/layouts/graphvizWorker.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/__tests__/test5.d.ts +25 -0
- package/types-3.4/graph2/graphT.d.ts +1 -0
- package/types-3.4/graph2/layouts/graphvizWorker.d.ts +0 -1
- package/dist/graphvizlib.wasm +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/graph",
|
|
3
|
-
"version": "2.84.
|
|
3
|
+
"version": "2.84.3",
|
|
4
4
|
"description": "hpcc-js - Viz Graph",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es6",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"clean": "rimraf lib* types dist *.tsbuildinfo workers/lib-* workers/dist workers/types workers/*.tsbuildinfo",
|
|
25
|
-
"copy-resources": "cpx \"../../node_modules/@hpcc-js/wasm/dist/graphvizlib.wasm\" \"./dist\"",
|
|
26
25
|
"compile-es6": "tsc --module es6 --outDir ./lib-es6",
|
|
27
26
|
"compile-es6-watch": "npm run compile-es6 -- -w",
|
|
28
27
|
"compile-umd": "tsc --module umd --outDir ./lib-umd",
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
"build-workers": "run-s compile-workers bundle-workers minimize-workers wrap-workers",
|
|
44
43
|
"build-package": "npm run compile-es6 && npm run bundle",
|
|
45
44
|
"gen-legacy-types": "downlevel-dts ./types ./types-3.4",
|
|
46
|
-
"build": "run-s build-workers
|
|
45
|
+
"build": "run-s build-workers build-package",
|
|
47
46
|
"watch": "npm-run-all compile-es6 -p compile-es6-watch bundle-watch",
|
|
48
47
|
"stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
|
|
49
48
|
"lint": "eslint ./src",
|
|
@@ -52,15 +51,15 @@
|
|
|
52
51
|
"update": "npx --yes npm-check-updates -u -t minor"
|
|
53
52
|
},
|
|
54
53
|
"dependencies": {
|
|
55
|
-
"@hpcc-js/api": "^2.12.
|
|
56
|
-
"@hpcc-js/common": "^2.71.
|
|
57
|
-
"@hpcc-js/html": "^2.42.
|
|
58
|
-
"@hpcc-js/react": "^2.53.
|
|
54
|
+
"@hpcc-js/api": "^2.12.6",
|
|
55
|
+
"@hpcc-js/common": "^2.71.6",
|
|
56
|
+
"@hpcc-js/html": "^2.42.7",
|
|
57
|
+
"@hpcc-js/react": "^2.53.2",
|
|
59
58
|
"@hpcc-js/util": "^2.50.1"
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|
|
62
61
|
"@hpcc-js/bundle": "^2.11.3",
|
|
63
|
-
"@hpcc-js/wasm": "
|
|
62
|
+
"@hpcc-js/wasm": "2.0.1",
|
|
64
63
|
"@types/d3-transition": "1.3.2",
|
|
65
64
|
"@types/dagre": "0.7.48",
|
|
66
65
|
"d3-array": "^1",
|
|
@@ -89,5 +88,5 @@
|
|
|
89
88
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
90
89
|
},
|
|
91
90
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
92
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "b5b4cf9ee4257885b41a3f90c11cbe6609704d0d"
|
|
93
92
|
}
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const PKG_NAME = "@hpcc-js/graph";
|
|
2
|
-
export const PKG_VERSION = "2.84.
|
|
3
|
-
export const BUILD_VERSION = "2.104.
|
|
2
|
+
export const PKG_VERSION = "2.84.3";
|
|
3
|
+
export const BUILD_VERSION = "2.104.13";
|
package/src/__tests__/test5.ts
CHANGED
|
@@ -42,7 +42,7 @@ const VERTEX_ARR_UPDATED = [{
|
|
|
42
42
|
text: "Vertex Three",
|
|
43
43
|
}];
|
|
44
44
|
|
|
45
|
-
const EDGE_ARR_UPDATE = [{
|
|
45
|
+
export const EDGE_ARR_UPDATE = [{
|
|
46
46
|
id: 0,
|
|
47
47
|
source: VERTEX_ARR_UPDATED[1],
|
|
48
48
|
target: VERTEX_ARR_UPDATED[2]
|
|
@@ -73,9 +73,13 @@ export class Test5 extends Graph2 {
|
|
|
73
73
|
.edgeArcDepth(0)
|
|
74
74
|
.layout("ForceDirected")
|
|
75
75
|
.on("vertex_click", (vertex, col, sel, anno) => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
console.info("vertex_click", vertex);
|
|
77
|
+
})
|
|
78
|
+
.on("vertex_dblclick", (vertex, col, sel, anno) => {
|
|
79
|
+
console.info("vertex_dblclick", vertex);
|
|
80
|
+
})
|
|
81
|
+
.on("vertex_contextmenu", (vertex, col, sel, anno) => {
|
|
82
|
+
console.info("vertex_contextmenu", vertex);
|
|
79
83
|
})
|
|
80
84
|
;
|
|
81
85
|
}
|
package/src/graph2/graphT.ts
CHANGED
|
@@ -192,14 +192,19 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
|
|
|
192
192
|
d3Select(this).classed("grabbed", false);
|
|
193
193
|
}
|
|
194
194
|
if (doClick) {
|
|
195
|
+
const event = d3Event();
|
|
195
196
|
context._selection.click({
|
|
196
197
|
_id: String(d.id),
|
|
197
198
|
element: () => d.element
|
|
198
|
-
},
|
|
199
|
+
}, event.sourceEvent);
|
|
199
200
|
context.selectionChanged();
|
|
200
201
|
const selected = d.element.classed("selected");
|
|
201
202
|
const eventOrigin = context.resolveEventOrigin();
|
|
202
|
-
|
|
203
|
+
if (event?.sourceEvent?.button === 2) {
|
|
204
|
+
context.vertex_contextmenu(d.props.origData || d.props, "", selected, eventOrigin);
|
|
205
|
+
} else {
|
|
206
|
+
context.vertex_click(d.props.origData || d.props, "", selected, eventOrigin);
|
|
207
|
+
}
|
|
203
208
|
const doClickTime = Date.now();
|
|
204
209
|
if (doClickTime - context._prevDoClickTime < context.doubleClickMaxDelay()) {
|
|
205
210
|
context.vertex_dblclick(d.props.origData || d.props, "", selected, eventOrigin);
|
|
@@ -763,6 +768,9 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
|
|
|
763
768
|
.on("dblclick", function (this: SVGElement, d) {
|
|
764
769
|
d3Event().stopPropagation();
|
|
765
770
|
})
|
|
771
|
+
.on("contextmenu", function (this: SVGElement, d) {
|
|
772
|
+
d3Event().preventDefault();
|
|
773
|
+
})
|
|
766
774
|
.on("mousein", function (d) {
|
|
767
775
|
Utility.safeRaise(this);
|
|
768
776
|
context.highlightVertex(d3Select(this), d);
|
|
@@ -1132,6 +1140,9 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
|
|
|
1132
1140
|
vertex_dblclick(row, _col, sel, data) {
|
|
1133
1141
|
}
|
|
1134
1142
|
|
|
1143
|
+
vertex_contextmenu(row, _col, sel, data) {
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1135
1146
|
vertex_mousein(row, _col, sel, data) {
|
|
1136
1147
|
}
|
|
1137
1148
|
|
|
@@ -1314,7 +1325,6 @@ export function graphviz(dot: string, engine: Engine = "dot", _scriptDir: string
|
|
|
1314
1325
|
links: [],
|
|
1315
1326
|
raw: dot
|
|
1316
1327
|
}, {
|
|
1317
|
-
engine: engine
|
|
1318
|
-
wasmFolder: new URL(scriptDir, document.baseURI).href
|
|
1328
|
+
engine: engine
|
|
1319
1329
|
});
|
|
1320
1330
|
}
|