[PreSales Question] Draggable Link Error

I’m trying to run the Draggable Link Sample: Draggable Link

After copying the code over to my solution I’m receiving the following error in Edge: ToolManager.replaceStandardTool:newtool value is not an instance of Tool: [object Object]

Firefox shows no error but nothing shows up in the toolbox.

Any pointers?

Kind Regards,
Bryce

Are you using go-debug.js and checking the console log for any warnings or errors?

If you used the sample code by copying and pasting, what’s the value of “$”?

Ok - narrowed it down a bit - see the code below. It works if I comment out the rotatingtool lines in the myDiagram declaration… Thoughts?

myDiagram =
$(go.Diagram, “myDiagramDiv”, // must name or refer to the DIV HTML element
{
grid: $(go.Panel, “Grid”,
$(go.Shape, “LineH”, { stroke: “lightgray”, strokeWidth: 0.5 }),
$(go.Shape, “LineH”, { stroke: “gray”, strokeWidth: 0.5, interval: 10 }),
$(go.Shape, “LineV”, { stroke: “lightgray”, strokeWidth: 0.5 }),
$(go.Shape, “LineV”, { stroke: “gray”, strokeWidth: 0.5, interval: 10 })
),
allowDrop: true, // must be true to accept drops from the Palette
“draggingTool.dragsLink”: true,
“draggingTool.isGridSnapEnabled”: true,
“linkingTool.isUnconnectedLinkValid”: true,
“linkingTool.portGravity”: 20,
“relinkingTool.isUnconnectedLinkValid”: true,
“relinkingTool.portGravity”: 20,
“relinkingTool.fromHandleArchetype”:
$(go.Shape, “Diamond”, { segmentIndex: 0, cursor: “pointer”, desiredSize: new go.Size(8, 8), fill: “tomato”, stroke: “darkred” }),
“relinkingTool.toHandleArchetype”:
$(go.Shape, “Diamond”, { segmentIndex: -1, cursor: “pointer”, desiredSize: new go.Size(8, 8), fill: “darkred”, stroke: “tomato” }),
“linkReshapingTool.handleArchetype”:
$(go.Shape, “Diamond”, { desiredSize: new go.Size(7, 7), fill: “lightblue”, stroke: “deepskyblue” }),
//rotatingTool: $(TopRotatingTool), // defined below
//“rotatingTool.snapAngleMultiple”: 15,
//“rotatingTool.snapAngleEpsilon”: 15,
“undoManager.isEnabled”: true
});

Is TopRotatingTool implemented as a “class” that inherits from Tool?

Ah! That pointed me the right direction - While I did copy/paste I had it was enclosed in a higher function that was messing it up. Thank you for the quick replies. Much obliged.

Hi Team,

I am converting this example to angular 2. Please find the git repository link below:

The code is in the app.component.ts and app.component.html

I am getting below error in console:
ToolManager.replaceStandardTool:newtool value is not an instance of Tool: [object Object]

You’ll need to debug this – what is that non-Tool object?

I resolved the issue and the integration of draggable link with angular 2 is here: