Tree mapping like one to one

Iam using tree maping in GoJS

How can I disable the the Mapped item like right side. If its mapped no need to map again like one to one mapping.

Thanks,

In that sample, each Node in the tree has a single port, which is the whole Node. You can set various port-related properties on port elements. (Note how there is already a Binding on the “toLinkable” property.) The ones that you want to set on the node template are GraphObject | GoJS API and GraphObject | GoJS API

fromMaxLinks: 1, toMaxLinks: 1,

We are unable to call the another function in the addDiagramListener callback function

this.myDiagram.addDiagramListener("LinkDrawn", function(e){ 
 this.showDialog();
  });

showDialog() {
.....
}

Result: Console error, Cannot read property ‘showDialog’ of undefined

any reason ?

Ah, that is how JavaScript trips up all programmers. Please read this - JavaScript | MDN or other web resources about “this” problem within function definitions.

It’s easiest to either use another variable:

var self = this;
  ... function(e) { ...self... }

or if you are writing ES6 code, use an arrow function:

  ... (e) => { ...this... }