Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7420

Showing link Labels Conditionally

$
0
0

@progs wrote:

I am trying to show link labels if the node and its child nodes are selected, I have the following code:

  myDiagram2.linkTemplate = 
      graph(go.Link, 
 	{ curve: go.Link.Bezier, toShortLength: 5 },
	{layerName: "Background"},
	graph(go.Shape,
	 	new go.Binding("stroke", "isHighlighted", function(h) { return h ? "#388E3C" : "#009BE1"; })
       	 	.ofObject()),
	graph(go.Shape, { toArrow: "Standard" },
	 	new go.Binding("stroke", "isHighlighted", function(h) { return h ? "#388E3C" : "#009BE1"; })
         	.ofObject()),
	graph(go.TextBlock, "",
		{font: "13px sans-serif", stroke: "black"},
                   //key binds to the "key" property in the json
		new go.Binding("text", "isHighlighted", function (h) { return h ? "key" : ""}))
)

In the below screen, shot, I'd like to show label text for all the green links:

Thanks

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7420

Trending Articles