I have a go.picture , but design can be changes based on same attribute value , so how can I customize based on data.
say for example
$(go.Picture, {
width: 20,
height: 20,
source: '../img/cat.svg',
imageAlignment: go.Spot.Top,
alignment: go.Spot.Right,
}),
here I have a set of nodes data in nodeDataArray, and if the name is cat , then the cource should be
source: '../img/cat.svg',
and if the name property in nodes array is dog , source should dynamically changes to source: '../img/dog.svg',
Imagine this is my data
const data = {
nodeDataArray: [
{ key: 0, name: "Cat", color: "lightblue", loc: "0 0" },
{ key: 1, name: "Dog", color: "orange", loc: "150 0" },
],
linkDataArray: [
{ key: -1, from: 0, to: 1 },
{ key: -2, from: 0, to: 2 },
],
skipsDiagramUpdate: false
};
Any help is highly helpful