Browse Source

fix typescript errors

mrkvon 4 years ago
parent
commit
93f9617ee4
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      src/app/graph/graph.component.ts
  2. 1
    1
      src/app/node.reducer.ts

+ 1
- 1
src/app/graph/graph.component.ts View File

@@ -38,7 +38,7 @@ export class GraphComponent implements OnChanges, OnInit {
38 38
 
39 39
   private selectNode = () => {
40 40
     const point = d3.mouse(this.graphContainer.nativeElement);
41
-    const node: Node = this.simulation.find(...point, 20);
41
+    const node = this.simulation.find(point[0], point[1], 20) as Node;
42 42
 
43 43
     if (node) this.select.emit(node.id);
44 44
   }

+ 1
- 1
src/app/node.reducer.ts View File

@@ -65,7 +65,7 @@ export function reducer(
65 65
 
66 66
     case NodeActionTypes.ToggleNodeSelection: {
67 67
       // add or remove a node with given id to selected node ids
68
-      if (state.ids.includes(action.payload.id)) {
68
+      if ((state.ids as string[]).includes(action.payload.id)) {
69 69
         if (state.selectedIds.includes(action.payload.id)) {
70 70
           // add
71 71
           return {