@kannanprs wrote:
Thanks for your response.
My requirement is text block need to be display with "file" icon (like software installed icon). I have created textblock with shape and included icon function . it will not display file icon . please find my code.
var commentTemplate =
$$(go.Node, "Auto", { selectable: false },
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),$$(go.Shape, { margin: 3, fill: colors["yellow"], strokeWidth: 0 }, new go.Binding("fill", "color"), new go.Binding("stroke", "borderColor"), new go.Binding("strokeWidth", "thickness"), new go.Binding("geometry", "geo", geoFunc)), $$(go.TextBlock, { margin: 1, maxSize: new go.Size(400, NaN), wrap: go.TextBlock.WrapFit, textAlign: "left", editable: true, font: "bold 12pt Helvetica, Arial, sans-serif", stroke: "rgb(0, 0, 0)", }, new go.Binding("text", "geo").makeTwoWay()) // no ports, because no links are allowed to connect with a comment );
var icons =
{
"file":
"M27.879 5.879l-3.757-3.757c-1.167-1.167-3.471-2.121-5.121-2.121h-14c-1.65 0-3 1.35-3 3v26c0 1.65 1.35 3 3 3h22c1.65 0 3-1.35 3-3v-18c0-1.65-0.955-3.955-2.121-5.121zM20 4.236c0.069 0.025 0.139 0.053 0.211 0.082 0.564 0.234 0.956 0.505 1.082 0.631l3.757 3.757c0.126 0.126 0.397 0.517 0.631 1.082 0.030 0.072 0.057 0.143 0.082 0.211h-5.764v-5.764zM26 28h-20v-24h12v8h8v16zM8 16h16v2h-16zM8 20h16v2h-16zM8 24h16v2h-16z",
"history":
"M18 2c7.732 0 14 6.268 14 14s-6.268 14-14 14v-3c2.938 0 5.701-1.144 7.778-3.222s3.222-4.84 3.222-7.778c0-2.938-1.144-5.701-3.222-7.778s-4.84-3.222-7.778-3.222c-2.938 0-5.701 1.144-7.778 3.222-1.598 1.598-2.643 3.601-3.041 5.778h5.819l-7 8-7-8h5.143c0.971-6.784 6.804-12 13.857-12zM24 14v4h-8v-10h4v6z",
};function geoFunc(geoname) { var geo = icons[geoname]; if (geo === undefined) geo = "file"; // use this for an unknown icon name if (typeof geo === "string") { geo = icons[geoname] = go.Geometry.parse(geo, true); // fill each geometry } return geo; };
Posts: 2
Participants: 2