@hpcc-js/graph 2.84.2 → 2.84.4

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 (64) hide show
  1. package/dist/index.es6.js +24 -24
  2. package/dist/index.es6.js.map +1 -1
  3. package/dist/index.js +22 -23
  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 +10 -11
  8. package/src/__package__.ts +2 -2
  9. package/src/__tests__/index.ts +1 -1
  10. package/src/__tests__/test5.ts +8 -4
  11. package/src/graph2/dataGraph.ts +9 -7
  12. package/src/graph2/graph.ts +12 -4
  13. package/src/graph2/graphReactT.ts +3 -3
  14. package/src/graph2/graphT.ts +37 -27
  15. package/src/graph2/index.ts +0 -1
  16. package/src/graph2/layouts/graphviz.ts +1 -2
  17. package/src/graph2/layouts/graphvizWorker.ts +1 -9
  18. package/src/graph2/layouts/placeholders.ts +15 -15
  19. package/src/graph2/sankeyGraph.ts +8 -8
  20. package/src/graph2/subgraph.tsx +2 -2
  21. package/src/graph2/vertex.tsx +2 -2
  22. package/types/__package__.d.ts +2 -2
  23. package/types/__tests__/index.d.ts +1 -1
  24. package/types/__tests__/test5.d.ts +25 -0
  25. package/types/__tests__/test5.d.ts.map +1 -1
  26. package/types/graph2/dataGraph.d.ts +4 -3
  27. package/types/graph2/dataGraph.d.ts.map +1 -1
  28. package/types/graph2/graph.d.ts +8 -3
  29. package/types/graph2/graph.d.ts.map +1 -1
  30. package/types/graph2/graphReactT.d.ts +3 -3
  31. package/types/graph2/graphReactT.d.ts.map +1 -1
  32. package/types/graph2/graphT.d.ts +11 -10
  33. package/types/graph2/graphT.d.ts.map +1 -1
  34. package/types/graph2/index.d.ts +0 -1
  35. package/types/graph2/index.d.ts.map +1 -1
  36. package/types/graph2/layouts/graphviz.d.ts.map +1 -1
  37. package/types/graph2/layouts/graphvizWorker.d.ts +0 -1
  38. package/types/graph2/layouts/graphvizWorker.d.ts.map +1 -1
  39. package/types/graph2/layouts/placeholders.d.ts +15 -15
  40. package/types/graph2/layouts/placeholders.d.ts.map +1 -1
  41. package/types/graph2/sankeyGraph.d.ts +5 -5
  42. package/types/graph2/sankeyGraph.d.ts.map +1 -1
  43. package/types/graph2/subgraph.d.ts +2 -2
  44. package/types/graph2/subgraph.d.ts.map +1 -1
  45. package/types/graph2/vertex.d.ts +2 -2
  46. package/types/graph2/vertex.d.ts.map +1 -1
  47. package/types-3.4/__package__.d.ts +2 -2
  48. package/types-3.4/__tests__/index.d.ts +1 -1
  49. package/types-3.4/__tests__/test5.d.ts +25 -0
  50. package/types-3.4/graph2/dataGraph.d.ts +4 -3
  51. package/types-3.4/graph2/graph.d.ts +8 -3
  52. package/types-3.4/graph2/graphReactT.d.ts +3 -3
  53. package/types-3.4/graph2/graphT.d.ts +11 -10
  54. package/types-3.4/graph2/index.d.ts +0 -1
  55. package/types-3.4/graph2/layouts/graphvizWorker.d.ts +0 -1
  56. package/types-3.4/graph2/layouts/placeholders.d.ts +15 -15
  57. package/types-3.4/graph2/sankeyGraph.d.ts +5 -5
  58. package/types-3.4/graph2/subgraph.d.ts +2 -2
  59. package/types-3.4/graph2/vertex.d.ts +2 -2
  60. package/dist/graphvizlib.wasm +0 -0
  61. package/src/graph2/edge.tsx +0 -30
  62. package/types/graph2/edge.d.ts +0 -9
  63. package/types/graph2/edge.d.ts.map +0 -1
  64. package/types-3.4/graph2/edge.d.ts +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/graph",
3
- "version": "2.84.2",
3
+ "version": "2.84.4",
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 copy-resources build-package",
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.5",
56
- "@hpcc-js/common": "^2.71.5",
57
- "@hpcc-js/html": "^2.42.6",
58
- "@hpcc-js/react": "^2.53.1",
59
- "@hpcc-js/util": "^2.50.1"
54
+ "@hpcc-js/api": "^2.12.7",
55
+ "@hpcc-js/common": "^2.71.7",
56
+ "@hpcc-js/html": "^2.42.8",
57
+ "@hpcc-js/react": "^2.53.3",
58
+ "@hpcc-js/util": "^2.50.2"
60
59
  },
61
60
  "devDependencies": {
62
61
  "@hpcc-js/bundle": "^2.11.3",
63
- "@hpcc-js/wasm": "1.16.5",
62
+ "@hpcc-js/wasm": "2.1.0",
64
63
  "@types/d3-transition": "1.3.2",
65
64
  "@types/dagre": "0.7.48",
66
65
  "d3-array": "^1",
@@ -76,7 +75,7 @@
76
75
  "d3-transition": "^1",
77
76
  "dagre": "0.8.5",
78
77
  "es6-promise": "4.2.8",
79
- "tslib": "2.4.0"
78
+ "tslib": "2.4.1"
80
79
  },
81
80
  "repository": {
82
81
  "type": "git",
@@ -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": "f44f2fba05bc3ac886f1169e43c884773e97d8fc"
91
+ "gitHead": "cec45fe4a28dff27d43cf0bb9238d751534c8e88"
93
92
  }
@@ -1,3 +1,3 @@
1
1
  export const PKG_NAME = "@hpcc-js/graph";
2
- export const PKG_VERSION = "2.84.2";
3
- export const BUILD_VERSION = "2.104.11";
2
+ export const PKG_VERSION = "2.84.4";
3
+ export const BUILD_VERSION = "2.104.14";
@@ -1 +1 @@
1
- export { Test5 as Test } from "./test5";
1
+ export { Test4 as Test } from "./test4";
@@ -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
- this
77
- .data({ vertices: VERTEX_ARR_UPDATED, edges: EDGE_ARR_UPDATE })
78
- .lazyRender();
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
  }
@@ -1,9 +1,11 @@
1
1
  import { PropertyExt, publish, Widget } from "@hpcc-js/common";
2
- import { CentroidVertex3, IVertex3, SubgraphProps, Vertex3 } from "@hpcc-js/react";
2
+ import { Vertex3, CentroidVertex3, Vertex3Props, EdgeProps, SubgraphProps } from "@hpcc-js/react";
3
3
  import { compare2 } from "@hpcc-js/util";
4
4
  import { Graph2 } from "./graph";
5
5
  import { HierarchyBase } from "./layouts/placeholders";
6
- import { BasicEdgeProps } from "./edge";
6
+
7
+ // Backward compatibility layer ---
8
+ export type IVertex3 = Vertex3Props;
7
9
 
8
10
  export function toJsonObj<T>(row, columns): T {
9
11
  const retVal: T = {} as T;
@@ -206,9 +208,9 @@ export class DataGraph extends Graph2 {
206
208
  this._prevVertices = vertices;
207
209
  }
208
210
 
209
- protected _prevEdges: readonly BasicEdgeProps[] = [];
210
- protected _masterEdges: BasicEdgeProps[] = [];
211
- private _masterEdgesMap: { [key: string]: BasicEdgeProps } = {};
211
+ protected _prevEdges: readonly EdgeProps<IVertex3>[] = [];
212
+ protected _masterEdges: EdgeProps<IVertex3>[] = [];
213
+ private _masterEdgesMap: { [key: string]: EdgeProps<IVertex3> } = {};
212
214
  mergeEdges() {
213
215
  const columns = this.edgeColumns();
214
216
  const idIdx = this.indexOf(columns, this.edgeIDColumn(), "id");
@@ -217,7 +219,7 @@ export class DataGraph extends Graph2 {
217
219
  const labelIdx = this.indexOf(columns, this.edgeLabelColumn(), "label");
218
220
  const weightIdx = this.indexOf(columns, this.edgeWeightColumn(), "weight");
219
221
  const colorIdx = this.indexOf(columns, this.edgeColorColumn(), "color");
220
- const edges: BasicEdgeProps[] = this.edges().map((e): BasicEdgeProps => {
222
+ const edges: EdgeProps<IVertex3>[] = this.edges().map((e): EdgeProps<IVertex3> => {
221
223
  const source = this._masterVerticesMap["" + e[sourceIdx]];
222
224
  if (!source) console.error(`Invalid edge source entity "${e[sourceIdx]}" does not exist.`);
223
225
  const target = this._masterVerticesMap["" + e[targetIdx]];
@@ -227,7 +229,7 @@ export class DataGraph extends Graph2 {
227
229
  source,
228
230
  target,
229
231
  weight: +e[weightIdx] || 1,
230
- color: e[colorIdx] as string,
232
+ stroke: e[colorIdx] as string,
231
233
  label: labelIdx >= 0 ? ("" + e[labelIdx]) : "",
232
234
  origData: toJsonObj(e, columns),
233
235
  labelPos: [0, 0],
@@ -1,11 +1,19 @@
1
- import { React, Subgraph, SubgraphProps, Vertex, VertexProps } from "@hpcc-js/react";
2
- import { BasicEdge, BasicEdgeProps } from "./edge";
1
+ import { React, Subgraph, SubgraphProps, Vertex, VertexProps, Edge, EdgeProps } from "@hpcc-js/react";
2
+ // import { IVertexEdgeProps, VertexEdge } from "./edge";
3
3
  import { GraphReactT } from "./graphReactT";
4
+ import { GraphDataProps, HierarchyBase } from "./graphT";
4
5
 
5
- export class Graph2 extends GraphReactT<SubgraphProps, VertexProps, BasicEdgeProps> {
6
+ // Backward compatibility layer ---
7
+ export type ISubgraph = SubgraphProps;
8
+ export type IVertex = VertexProps;
9
+ export type IEdge = EdgeProps;
10
+ export type IHierarchy = HierarchyBase<ISubgraph, IVertex>;
11
+ export type IGraphData2 = GraphDataProps<ISubgraph, IVertex, IEdge>;
12
+
13
+ export class Graph2 extends GraphReactT<ISubgraph, IVertex, IEdge> {
6
14
 
7
15
  constructor() {
8
- super(Subgraph, Vertex, BasicEdge);
16
+ super(Subgraph, Vertex, Edge);
9
17
  this._reactCentroidRenderer = Vertex;
10
18
  this._reactVertexRenderer2 = Vertex;
11
19
  super.vertexRenderer((props) => {
@@ -1,11 +1,11 @@
1
- import { render, React, SubgraphProps, VertexProps } from "@hpcc-js/react";
2
- import { EdgeProps, GraphT, RendererT } from "./graphT";
1
+ import { render, React, SubgraphProps, VertexProps, EdgeProps } from "@hpcc-js/react";
2
+ import { GraphT, RendererT } from "./graphT";
3
3
 
4
4
  function adapter<T>(reactRenderer: React.FunctionComponent<T>): RendererT<T> {
5
5
  return (props: T, element: SVGGElement) => render(reactRenderer, props, element);
6
6
  }
7
7
 
8
- export class GraphReactT<SG extends SubgraphProps, V extends VertexProps, E extends EdgeProps> extends GraphT<SG, V, E> {
8
+ export class GraphReactT<SG extends SubgraphProps, V extends VertexProps, E extends EdgeProps<V>> extends GraphT<SG, V, E> {
9
9
 
10
10
  constructor(subgraphRenderer: React.FunctionComponent<SG>, vertexRenderer: React.FunctionComponent<V>, edgeRenderer: React.FunctionComponent<E>) {
11
11
  super(adapter(subgraphRenderer), adapter(vertexRenderer), adapter(edgeRenderer));
@@ -7,7 +7,7 @@ import "d3-transition";
7
7
  import { interpolatePath as d3InterpolatePath } from "d3-interpolate-path";
8
8
  import { Circle, Dagre, ForceDirected, ForceDirectedAnimated, Graphviz, ILayout, Null } from "./layouts/index";
9
9
  import { Options as FDOptions } from "./layouts/forceDirectedWorker";
10
- import type { VertexProps, EdgeProps, IGraphData2, HierarchyBase, SubgraphProps } from "./layouts/placeholders";
10
+ import type { VertexBaseProps, EdgeBaseProps, GraphDataProps, HierarchyBase, SubgraphBaseProps } from "./layouts/placeholders";
11
11
  import { EdgePlaceholder, SubgraphPlaceholder, VertexPlaceholder, isEdgePlaceholder } from "./layouts/placeholders";
12
12
  import { Engine, graphviz as gvWorker } from "./layouts/graphvizWorker";
13
13
  import { Tree, RadialTree, Dendrogram, RadialDendrogram } from "./layouts/tree";
@@ -18,25 +18,25 @@ let scriptDir = (globalThis?.document?.currentScript as HTMLScriptElement)?.src
18
18
  scriptDir = scriptDir.substring(0, scriptDir.replace(/[?#].*/, "").lastIndexOf("/") + 1);
19
19
 
20
20
  export {
21
- IGraphData2,
22
- SubgraphProps,
23
- VertexProps,
24
- EdgeProps,
21
+ GraphDataProps,
22
+ SubgraphBaseProps,
23
+ VertexBaseProps,
24
+ EdgeBaseProps,
25
25
  HierarchyBase
26
26
  };
27
27
 
28
28
  type GraphLayoutType = "Hierarchy" | "DOT" | "Tree" | "Dendrogram" | "RadialTree" | "RadialDendrogram" | "ForceDirected" | "ForceDirected2" | "ForceDirectedHybrid" | "Neato" | "FDP" | "Circle" | "TwoPI" | "Circo" | "None";
29
29
  const GraphLayoutTypeSet = ["Hierarchy", "DOT", "Tree", "Dendrogram", "RadialTree", "RadialDendrogram", "ForceDirected", "ForceDirected2", "ForceDirectedHybrid", "Neato", "FDP", "Circle", "TwoPI", "Circo", "None"];
30
30
 
31
- function dragStart<V extends VertexProps>(n: VertexPlaceholder<V>) {
31
+ function dragStart<V extends VertexBaseProps>(n: VertexPlaceholder<V>) {
32
32
  n.fx = n.sx = n.x;
33
33
  n.fy = n.sy = n.y;
34
34
  }
35
- function dragTick(n: VertexPlaceholder<VertexProps>, d: VertexPlaceholder<VertexProps>) {
35
+ function dragTick(n: VertexPlaceholder<VertexBaseProps>, d: VertexPlaceholder<VertexBaseProps>) {
36
36
  n.fx = n.sx + d.fx - d.sx;
37
37
  n.fy = n.sy + d.fy - d.sy;
38
38
  }
39
- function dragEnd<V extends VertexProps>(n: VertexPlaceholder<V>) {
39
+ function dragEnd<V extends VertexBaseProps>(n: VertexPlaceholder<V>) {
40
40
  n.x = n.fx;
41
41
  n.y = n.fy;
42
42
  n.fx = n.sx = undefined;
@@ -45,7 +45,7 @@ function dragEnd<V extends VertexProps>(n: VertexPlaceholder<V>) {
45
45
 
46
46
  export type RendererT<T> = (props: T, element: SVGGElement) => void;
47
47
 
48
- export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends EdgeProps> extends SVGZoomWidget {
48
+ export class GraphT<SG extends SubgraphBaseProps, V extends VertexBaseProps, E extends EdgeBaseProps<V>> extends SVGZoomWidget {
49
49
 
50
50
  protected _centroidFilter: SVGGlowFilter;
51
51
 
@@ -63,11 +63,11 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
63
63
  private _toggleD = new ToggleButton().faChar("fa-sitemap fa-rotate-270").tooltip("Dendrogram").on("click", () => this.layoutClick("Dendrogram"));
64
64
  private _toggleRD = new ToggleButton().faChar("fa-asterisk").tooltip("Radial Dendrogram").on("click", () => this.layoutClick("RadialDendrogram"));
65
65
 
66
- protected _graphData = new GraphCollection<VertexPlaceholder<V>, EdgePlaceholder<E, V>, SubgraphPlaceholder<SG>>()
66
+ protected _graphData = new GraphCollection<VertexPlaceholder<V>, EdgePlaceholder<V, E>, SubgraphPlaceholder<SG>>()
67
67
  .idFunc(d => d.id)
68
68
  .sourceFunc(e => e.source.id)
69
69
  .targetFunc(e => e.target.id)
70
- .updateFunc((b: VertexPlaceholder<V> | EdgePlaceholder<E, V> | SubgraphPlaceholder<SG>, a: VertexPlaceholder<V> | EdgePlaceholder<E, V> | SubgraphPlaceholder<SG>) => {
70
+ .updateFunc((b: VertexPlaceholder<V> | EdgePlaceholder<V, E> | SubgraphPlaceholder<SG>, a: VertexPlaceholder<V> | EdgePlaceholder<V, E> | SubgraphPlaceholder<SG>) => {
71
71
  b.props = a.props;
72
72
  if (isEdgePlaceholder(a) && isEdgePlaceholder(b)) {
73
73
  b.source = a.source;
@@ -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
- }, d3Event().sourceEvent);
199
+ }, event.sourceEvent);
199
200
  context.selectionChanged();
200
201
  const selected = d.element.classed("selected");
201
202
  const eventOrigin = context.resolveEventOrigin();
202
- context.vertex_click(d.props.origData || d.props, "", selected, eventOrigin);
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);
@@ -254,15 +259,15 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
254
259
  return this;
255
260
  }
256
261
 
257
- private _origData: IGraphData2<SG, V, E> = {
262
+ private _origData: GraphDataProps<SG, V, E> = {
258
263
  subgraphs: [],
259
264
  vertices: [],
260
265
  edges: [],
261
266
  hierarchy: []
262
267
  };
263
- data(): IGraphData2<SG, V, E>;
264
- data(_: IGraphData2<SG, V, E>, merge?: boolean): this;
265
- data(_?: IGraphData2<SG, V, E>, merge?: boolean): IGraphData2<SG, V, E> | this {
268
+ data(): GraphDataProps<SG, V, E>;
269
+ data(_: GraphDataProps<SG, V, E>, merge?: boolean): this;
270
+ data(_?: GraphDataProps<SG, V, E>, merge?: boolean): GraphDataProps<SG, V, E> | this {
266
271
  if (_ === void 0) return this._origData;
267
272
  this._origData = _;
268
273
 
@@ -320,7 +325,7 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
320
325
  return this;
321
326
  }
322
327
 
323
- graphData(): GraphCollection<VertexPlaceholder<V>, EdgePlaceholder<E, V>> {
328
+ graphData(): GraphCollection<VertexPlaceholder<V>, EdgePlaceholder<V, E>> {
324
329
  return this._graphData;
325
330
  }
326
331
 
@@ -504,7 +509,7 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
504
509
 
505
510
  highlightEdges(edgeMap?: { [id: string]: boolean }) {
506
511
  const context = this;
507
- const edgeElements = this._edgeG.selectAll<SVGGElement, EdgePlaceholder<E, V>>(".graphEdge");
512
+ const edgeElements = this._edgeG.selectAll<SVGGElement, EdgePlaceholder<V, E>>(".graphEdge");
508
513
  edgeElements
509
514
  .classed("graphEdge-highlighted", d => !edgeMap || edgeMap[d.id])
510
515
  .style("stroke-width", function (o) {
@@ -538,7 +543,7 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
538
543
  }
539
544
  }
540
545
 
541
- highlightEdge(_element, d?: EdgePlaceholder<E, V>) {
546
+ highlightEdge(_element, d?: EdgePlaceholder<V, E>) {
542
547
  if (this.highlightOnMouseOverEdge()) {
543
548
  if (d) {
544
549
  const vertices = {};
@@ -572,7 +577,7 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
572
577
  return this;
573
578
  }
574
579
 
575
- moveEdgePlaceholder(ep: EdgePlaceholder<E, V>, transition: boolean): this {
580
+ moveEdgePlaceholder(ep: EdgePlaceholder<V, E>, transition: boolean): this {
576
581
  const edgeLayout = {
577
582
  ...this._layoutAlgo.edgePath(ep, this.edgeArcDepth())
578
583
  };
@@ -589,7 +594,7 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
589
594
  path: pathInterpolator(t),
590
595
  labelPos: labelPosInterpolator(t),
591
596
  strokeWidth: ep.props.strokeWidth ?? context.edgeStrokeWidth(),
592
- color: ep.props.color ?? context.edgeColor()
597
+ color: ep.props.stroke ?? context.edgeColor()
593
598
  };
594
599
  context._edgeRenderer({ ...edgeLayout, ...ep.props, ...updated }, ep.element.node());
595
600
  };
@@ -600,7 +605,7 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
600
605
 
601
606
  moveVertexPlaceholder(vp: VertexPlaceholder<V>, transition: boolean, moveNeighbours: boolean): this {
602
607
  const { x, y } = this.projectPlacholder(vp);
603
- vp.element && (transition ? vp.element.transition().duration(this.transitionDuration()) as unknown as Selection<SVGPathElement, EdgePlaceholder<E, V>, SVGGElement, any> : vp.element)
608
+ vp.element && (transition ? vp.element.transition().duration(this.transitionDuration()) as unknown as Selection<SVGPathElement, EdgePlaceholder<V, E>, SVGGElement, any> : vp.element)
604
609
  .attr("transform", `translate(${x} ${y})`)
605
610
  ;
606
611
  if (moveNeighbours) {
@@ -690,7 +695,7 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
690
695
  updateEdges(): this {
691
696
  const context = this;
692
697
  this._edgeG.selectAll(".graphEdge")
693
- .data(this._graphData.allEdges(), (d: EdgePlaceholder<E, V>) => d.id)
698
+ .data(this._graphData.allEdges(), (d: EdgePlaceholder<V, E>) => d.id)
694
699
  .join(
695
700
  enter => enter.append("g")
696
701
  .attr("class", "graphEdge")
@@ -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
 
@@ -1157,7 +1168,7 @@ export class GraphT<SG extends SubgraphProps, V extends VertexProps, E extends E
1157
1168
  }
1158
1169
  GraphT.prototype._class += " graph_GraphT";
1159
1170
 
1160
- export interface GraphT<SG extends SubgraphProps = any, V extends VertexProps = any, E extends EdgeProps = any> {
1171
+ export interface GraphT<SG extends SubgraphBaseProps = any, V extends VertexBaseProps = any, E extends EdgeBaseProps<V> = any> {
1161
1172
  allowDragging(): boolean;
1162
1173
  allowDragging(_: boolean): this;
1163
1174
  dragSingleNeighbors(): boolean;
@@ -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
  }
@@ -5,4 +5,3 @@ export * from "./dataGraph";
5
5
  export * from "./sankeyGraph";
6
6
  export * from "./subgraph";
7
7
  export * from "./vertex";
8
- export * from "./edge";
@@ -59,8 +59,7 @@ export class Graphviz extends Layout {
59
59
  })),
60
60
  raw: ""
61
61
  }, {
62
- engine: this._engine,
63
- wasmFolder: this._wasmFolder
62
+ engine: this._engine
64
63
  }).response.then((response: any) => {
65
64
  if (this.running()) {
66
65
  response.clusters.forEach(n => {