Unable to get images to show in nodes

I have looked at several of examples.

I am using a “ForceDirectedLayout” graph and have added 5 nodes. The graph and nodes show as expected but do not see any images.

The pertinent code snippets.

                { maxSize: new go.Size(250, 250) },
                new go.Binding("source", "img") ),

for (var i = 0 ; i < 5; i++) {
        var node = {
            key:   i,
            parent: '1',
            text:  'Node_' + i,
            img: 'images/gojs_switch.png'
       // add the node

       // add some lingk
        // from, to, color
        linkDataArray.push (this.getLink(0,i, 'red'))
        linkDataArray.push (this.getLink(0,i, 'green'))


Like I said, everything shows as expected in the graph but do not see any images.

The obvious question is whether the relative URL “images/gojs_switch.png” really produces a valid image file. I suppose you can try this by adding an <IMG src=“images/gojs_switch.png” /> to your HTML page and see if the image shows properly.

Yes it does. I have been using this same image in my evaluation of vis.js and cytoscape.js and works fine in their graphs. I admit this does seem strange but currently at a loss to figure why it won’t work here.

Are there any console messages when you are using the Debug library, go-debug.js?

Nope, first thing I checked using go-debug.js and have console open, no error being displayed unless of course I have some bogus properties which have fixed so I know it will display errors.

Can we see an example of this somehow? Perhaps making a public codepen that reproduces what you’re seeing?

You can fork this to start: http://codepen.io/simonsarris/pen/DzIwK