Cannot Interact with Node

Good day,

Is there any known reason about why a node would not be interactable besides setting allowSelect = false on a layer or making the diagram readOnly?

I have a simple diagram with 4 nodes (with ports and links). All of the nodes, ports, and links are being created and are visible as expected. However, I can only interact with a single node (Select, Click, Move, etc) - if I try to interact with the others, I get the basic diagram panning behavior instead.

Could you provide guidance?

Thanks in advance.

This page talks about controlling what users may do: http://gojs.net/latest/intro/permissions.html

I would guess that it’s most likely that you have set or data bound Part.selectable to false. Also possible (but less likely) is setting or binding GraphObject.pickable to false.

Hmmm. A more mischievous possibility is that you have added a transparent object in front of those nodes and links so that the user can see them but cannot interact with them because that “glass” object is getting all of the mouse events, but that object is not Part.selectable.

I’m not binding those properties, but I’ll investigate to double check.

How would I be able to know if I’ve added a transparent object of some sort? My GraphLinksModel doesn’t have any extra nodes in it.

If you implemented the diagram, you would know.

That “glass” part need not be in the model – it could just be an unmodeled Node or simple Part. This talks about such parts for a different purpose: http://gojs.net/latest/intro/legends.html. And the first few pages of the Introduction (starting with http://gojs.net/latest/intro/buildingObjects.html) use that technique because models and templates and data binding hadn’t been introduced yet.

After further investigation, I’ve narrowed the issue down to the port itemTemplate. Not that I’m sure it’s the actual itemTemplate causing the problem, but it’s the only way I can ensure that problem does or does not occur.

If I set the item template, then I cannot interact with my diagram. If I remove the item template, I can interact just fine.

See the template below:

inPortTemplate = $go(go.Panel, go.Panel.Vertical, { toolTip: $go(go.Adornment, "Auto", { visible: false }, $go(go.Shape, { fill: "#FFFFCC" }), $go(go.TextBlock, { margin: 3 }, new go.Binding("text", "label"))) }, $go(go.TextBlock, { visible: true }, new go.Binding("text", "label")), $go(go.Shape, { fromLinkable: false, toLinkable: true, fromSpot: go.Spot.RightSide, toSpot: go.Spot.LeftSide, strokeWidth: 2, stroke: "black" }, new go.Binding("portId", "id"), new go.Binding("geometryString", "", (a, b) => { return this.getGeoString(true, true, a.type); })) );

I think I need more description of what kind of interaction you want and what kinds of interaction are still allowed with such nodes.

(It would also help to indent the code properly.)

I can share more about this sensitive project via email if that’s possible?

Yes, send us email at nwoods.com, with the name “GoJS”, or via our web site: http://www.nwoods.com/contact.html