The Link template depends on a custom MultiColorLink class to render sections of each of the path Shapes that it has in a different color. The colors are specified in the link data object's colors property, an Array of CSS color strings. The template must have as many GraphObject.isPanelMain Shapes in it as the maximum length of the Arrays of colors. This sample's template has five path Shapes in it so that it can render in five different colors. But if for example you need to show at most two colors, for efficiency you should change the template to have only two path Shapes in it.