I'm trying to use an image as the shape of a node. My problem is that I don't know what the size of the image will be. So I don't want to set the width or height of the node.
It looks like your control does set the size of the node to the size of the image. I had a look at the code on GitHub and saw that a 'measure element' is being used to find out the size of the image. The node's size is then set to the image's size.
However, there seems to be a bug with this. If the image doesn't load fast enough, the node's width and height are set to 0.
I have attached a sample which I hope demonstrates this.
The diagram has two nodes.
The first node uses an image that is 300px by 300px. It's width and height are set to 0, which isn't right.
The second node uses an image that is 150px by 150px. It's width and height are set to 150, which is correct. But this is only because the browser cached the image when it displayed the image above the diagram.