I am experimenting with allowing users to drag links as if they were a node (like your draggableLink Sample)
I just turned out the appropriate link parameters to my code:
this.diagram.toolManager.linkingTool.isUnconnectedLinkValid = true;
this.diagram.toolManager.relinkingTool.isUnconnectedLinkValid = true;
this.diagram.toolManager.draggingTool.dragsLink = true;
But when a stretch an input link out I get this error on releasing the mouse:
svm-select.module.ts:24 TypeError: Cannot read property ‘pi’ of null
at Tr (go.js:1710)
at Rr (go.js:1636)
at W.webpackJsonp…/node_modules/gojs/release/go.js.W.getLinkPoint (go.js:1637)
at W.webpackJsonp…/node_modules/gojs/release/go.js.W.computePoints (go.js:1632)
at W.webpackJsonp…/node_modules/gojs/release/go.js.W.updateRoute.W.co (go.js:1626)
at W. (go.js:1611)
at W.webpackJsonp…/node_modules/gojs/release/go.js.g.Nn (go.js:1161)
at xk (go.js:1014)
at E.webpackJsonp…/node_modules/gojs/release/go.js.E.CB (go.js:788)
at Ii (go.js:787)
How do I switch to go-debug.js? Using ts, Angular 4.xx angular-cli
I did switch all my imports to: from ‘gojs/release/go-debug’
but I then get compile errors on the extensions ERROR in C:/Users/nelson/Documents/code/svm-angular/src/app/svmesa/model-editor/editor/diagram/model-editor-diagram.component.ts (159,9): Type 'RealtimeDragSelectingTool' is not assignable to type 'DragSelectingTool'. Types of property 'box' are incompatible. Type 'go.Part' is not assignable to type 'go.Part'. Two different types with this name exist, but they are unrelated. Types of property 'adornments' are incompatible. Type 'go.Iterator<Adornment>' is not assignable to type 'go.Iterator<Adornment>'. Two different types with this name exist, but they are unrelated. Types of property 'value' are incompatible. Type 'go.Adornment' is not assignable to type 'go.Adornment'. Two different types with this name exist, but they are unrelated. Types of property 'adornedObject' are incompatible. Type 'go.GraphObject' is not assignable to type 'go.GraphObject'. Two different types with this name exist, but they are unrelated. Types of property 'actionCancel' are incompatible. Type '(e: InputEvent, obj: GraphObject) => void' is not assignable to type '(e: InputEvent, obj: GraphObject) => void'. Two different types with this name exist, but they are unrelated. Types of parameters 'e' and 'e' are incompatible. Type 'go.InputEvent' is not assignable to type 'go.InputEvent'. Two different types with this name exist, but they are unrelated.
I am using everywhere in my code.
import * as go from ‘gojs/release/go-debug’;
But I am also importing some goJs Extensions:
import {NodeLabelDraggingTool} from ‘gojs/extensionsTS/NodeLabelDraggingTool’;
import {RealtimeDragSelectingTool} from ‘gojs/extensionsTS/RealtimeDragSelectingTool’;
which are importing
import * as go from “…/release/go”;
which is the cause of the load of both the debug and the release code.
Do i have to go in and change the imports in the extensions themselves?
SO I got debugging code running by changing the imports in the extensions.
Here is the stack trace of the error I get from my original question:
svm-select.module.ts:24 TypeError: Cannot read property ‘Fi’ of null
at as (go-debug.js:1791)
at Zr (go-debug.js:1717)
at J.webpackJsonp…/node_modules/gojs/release/go-debug.js.J.getLinkPoint (go-debug.js:1718)
at J.webpackJsonp…/node_modules/gojs/release/go-debug.js.J.computePoints (go-debug.js:1713)
at J.webpackJsonp…/node_modules/gojs/release/go-debug.js.J.updateRoute.J.Ao (go-debug.js:1707)
at J. (go-debug.js:1691)
at J.webpackJsonp…/node_modules/gojs/release/go-debug.js.f.jo (go-debug.js:1223)
at Gk (go-debug.js:1071)
at E.webpackJsonp…/node_modules/gojs/release/go-debug.js.E.eC (go-debug.js:840)
at Ti (go-debug.js:839)