Thanks walter. now each shape have a different image but the image displayed is always cut off. I have read here and used imageStretch: go.GraphObject.Fill
but my image still cut off. here is my code
$(go.Picture, { margin: 2, width: 30, height: 30, background: null, imageStretch: go.GraphObject.Fill },
new go.Binding("source")),
myPalette = $(go.Palette, "myPalette", {
nodeTemplate: myDiagram.nodeTemplate,
groupTemplate: myDiagram.groupTemplate,
layout: $(go.GridLayout)
});
var item = [];
<?php while($row = db_fetch($result)) { ?>''
var c = {key: "g", size: "100 100", source: ""+<?php echo $row['image']?>+""}
item.push(c);
<?php } ?>
myPalette.model = new go.GraphLinksModel(item);