Setting graph-layout="{name:'cose'"} causes Cannot read property 'length' of undefined error. This only seems to happen on initialization. Other layouts do not reproduce this error.
Removing newDefaults.layout = isDefined(userLayout) ? userLayout : {name:'grid'}; from graph defaults fixed issue. Initial layouts are now run after graph creation.
Setting graph-layout="{name:'cose'"} causes Cannot read property 'length' of undefined error. This only seems to happen on initialization. Other layouts do not reproduce this error.