Otherwise you can grab the text from the TextBlock that is (or is within) the label on the link. You could do that by giving that TextBlock a name in your link template. Let’s say that name is “LABEL”, for example in:
@walter Thanks so much. This worked great. Now I am understanding iterators with this solution. Now I just need to learn how to add an adornment with a count value. Any pointers there would be great. FYI, we are in evaluation mode with GoJS and will be getting a seat shortly. Very impressed with this framework - and this is after evaluating many. Great job.
Thank you for your kind words. I guess having experience produces better results.
When do you want that count to be showing? If it is all the time for all nodes (or if you are asking about links – same answer), then just add it to the template.
If it is whenever the node or link is selected, then specify a custom selection Adornment that includes the count. GoJS Selection -- Northwoods Software
If it is some other circumstance, please elaborate when and how.
When I successfully bring back all the incoming link labels using the above method, how do I push them into a single array? I have this:
linksInto.each(function(link) {
var lab = link.findObject("linkName");
console.log("in--"+lab.text);
//topicIns.push = lab.text;
var arr = [];
arr.push(lab.text);
console.log(arr);
self.topicIns = arr;
})
This is pushing 3 separate arrays VS a single array:
Is there a way to make the results from the .each to be a single array? is there a GoJS way or how would I do this in regular JS if that is recommended?
I took a break, went to see my family, thought about it a bit more and was like: ‘what if I remove the array assignment out of the function’ …hmm…tried it when I got back home. Worked:
var arr = [];
var linksInto = node.findLinksInto();
var linksOutof = node.findLinksOutOf();
linksInto.each(function(link) {
var lab = link.findObject("linkName");
console.log("in--"+lab.text);
//topicIns.push = lab.text;
var ins = lab.text;
arr.push(lab.text);
})
self.topicIns = arr
As you can probably tell, I am new to programming (actually went to school for painting). Thanks again!