Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Several types links in LinkTemplateMap

$
0
0

@jokl wrote:

I have 3 types of objects - A, B and C.

If I have an A -> B relationship, then I need one type of link, if A -> C, then another type.

I can do this with 2 different types of links and write them LinkTemplateMap and linkDataArray to specify the category. Example:

myDiagram.linkTemplateMap.add("first",
	$(go.Link,
        $(go.Shape,
        { stroke: "blue", strokeWidth: 5 }),
        $(go.Shape,
        {
            fill: "blue",
            stroke: null,
            toArrow: "Standard",
            scale: 2.5
        })
));
	
	
myDiagram.linkTemplateMap.add("second",
	$(go.Link,
        $(go.Shape,
        $(go.Shape,
        {
            toArrow: "Diamond"
        })
));

"linkDataArray": [
{"from":"a", "to":"b", "category":"first"},
{"from":"a", "to":"c", "category":"second"},
]

Are there ways to do this without having a property with a category? What is the best way to solve my problem?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles