// initialize the Palette that is on the left side of the page
myPalette =
$(go.Palette, "myPaletteDiv", // must name or refer to the DIV HTML element
{
maxSelectionCount: 1,
nodeTemplateMap: myDiagram.nodeTemplateMap, // share the templates used by myDiagram
linkTemplate: // simplify the link template, just in this Palette
$(go.Link,
{ // because the GridLayout.alignment is Location and the nodes have locationSpot == Spot.Center,
// to line up the Link in the same manner we have to pretend the Link has the same location spot
locationSpot: go.Spot.Center,
selectionAdornmentTemplate:
$(go.Adornment, "Link",
{ locationSpot: go.Spot.Center },
$(go.Shape,
{ isPanelMain: true, fill: null, stroke: "deepskyblue" }),
$(go.Shape, // the arrowhead
{ toArrow: "Standard", stroke: null })
)
},
{
routing: go.Link.AvoidsNodes,
curve: go.Link.JumpOver,
corner: 5,
toShortLength: 4
},
new go.Binding("points"),
$(go.Shape, // the link path shape
{ isPanelMain: true, strokeWidth: 2, new go.Binding("strokeDashArray", "dash")}),
$(go.Shape, // the arrowhead
{ toArrow: "Standard", stroke: null }),
),
model: new go.GraphLinksModel([ // specify the contents of the Palette
{ text: "", "size":"40 20", fill: "white", dmnshape: "Decision" },
{ text: "", figure: "KnowledgeX", "size":"40 20", fill: "white", dmnshape: "Knowledge" },
{ text: "", figure: "KnowledgeSourceX", "size":"40 20", fill: "white", dmnshape: "Knowledge Source" },
{ text: "", figure: "InputX", "size": "40 20", fill: "white", dmnshape: "Input" },
{ text: "", figure: "AnnotationX", "size":"40 20", fill: "white", dmnshape: "Annotation" }
], [
// the Palette also has a disconnected Link, which the user can drag-and-drop
{ dash:[], points: new go.List(/*go.Point*/).addAll([new go.Point(0, 0), new go.Point(30, 0), new go.Point(30, 40), new go.Point(60, 40)]) },
{ dash: [5,10], points: new go.List(/*go.Point*/).addAll([new go.Point(0, 0), new go.Point(30, 0), new go.Point(30, 40), new go.Point(60, 40)]) }
])
});
new go.Binding(“strokeDashArray”, “dash”) causes an error “Uncaught SyntaxError: Unexpected identifier”. However, if I simply put in strokeDashArray: [5,10] it displays as expected with no error. Are there issues with nested bindings? Am I missing something? Thank you.