How to change image on click?

changeWaitIcon(e , obj) {
const pic = obj.part;
pic.diagram.startTransaction(‘update_icon’);
obj.part.source = build_path + ‘assets/icons/node_icons/link_data/wait-link.svg’;
pic.diagram.commitTransaction(‘update_icon’);
}

I tried but no result please suggest.

obj.part returns a Part, probably a Node in your case.

There is no Part.source property. There is only a Picture.source property. So you are setting a meaningless property on the Node.

Find the Picture within the Part. If you give the Picture a GraphObject.name, then you can call Panel.findObject. If you find the Picture, then you can set its Picture.source.

Please read https://gojs.net/latest/learn/graphObject.html.

Thank you very much for your help