Why can’t I see the icon with this code (assuming I’m using the twitter strong from the icons example), also what’s the best way to go about moving the icon to the lower left corner:
// A data binding conversion function. Given an icon name, return the icon's Path string.
function geoFunc(geoname) {
if(icons[geoname]) {
return icons[geoname];
}
}
graph(go.Node, "Auto",
{margin: new go.Margin(0,30,0,30),
fromSpot: go.Spot.Right, // coming out from middle-right
toSpot: go.Spot.Left},
{
copyable: false,
resizable: true,
resizeObjectName: "SHAPE",
resizeAdornmentTemplate:
graph(go.Adornment, "Spot",
graph(go.Placeholder),
graph(go.Shape, { alignment: go.Spot.Left, cursor: "e-resize", desiredSize: new go.Size(6, 16), fill: "#388E3C", stroke: "#388E3C" }),
graph(go.Shape, { alignment: go.Spot.Right, cursor: "e-resize", desiredSize: new go.Size(6, 16), fill: "#388E3C", stroke: "#388E3C" }),
graph(go.Shape, { alignment: go.Spot.Bottom, cursor: "e-resize", desiredSize: new go.Size(16, 6), fill: "#388E3C", stroke: "#388E3C" })
),
selectionAdorned: false,
mouseEnter: mouseEnter,
mouseLeave: function (e, node) {mouseLeave(node); },
// click: showConnections
},
// bind the Part.layerName to control the Node's layer depending on whether it isSelected
new go.Binding("layerName", "isSelected", function(sel) { return sel ? "Foreground" : ""; }).ofObject(),
graph(go.Shape, "RoundedRectangle",
{name: "SHAPE", fill: "#FFF", minSize: new go.Size(200, 100), cursor: "pointer"},
new go.Binding("stroke", "isHighlighted", function(h) { return h ? "#388E3C" : "#009BE1"; })
.ofObject(),
new go.Binding("stroke", "isSelected", function(selected) {if (selected) return "#388E3C"; else return "#009BE1";})
.ofObject(""),
new go.Binding("fill", "isHighlighted", function(h) { return h ? "#E9F9D7" : "#FFF"; })
.ofObject(),
new go.Binding("fill", "isSelected", function(selected) {if (selected) return "#E9F9D7"; else return "#FFF";})
.ofObject("")),
graph(go.TextBlock, "Default Text",
{name: "TEXT", stroke: "black", font: "16px sans-serif", cursor: "pointer"},
new go.Binding("stroke", "isHighlighted", function(h) { return h ? "black" : "black"; })
.ofObject(),
new go.Binding("text", "key")),
$(go.Shape, "Rectangle",
{ fill: "lightcoral", strokeWidth: 1, stroke: "gray", width: 30, height: 30 }),
$(go.Panel, "Vertical",
{ margin: 3 },
$(go.Shape,
{ fill: "#FFF", strokeWidth: 0 },
new go.Binding("geometryString", "geo", geoFunc))
),
{
)
I’m getting the following: