Closed ian-j-stewart closed 1 year ago
I can't reproduce it : https://codesandbox.io/s/react-sigma-issues-37-96mf3d?file=/src/App.tsx
This is a list of what you test / correct on your code :
Initialize your graph with a string is bad idea. You should change that : const [rendergraph, setRendergraph] = useState('');
by something like that :
const [rendergraph, setRendergraph] = useState(null);`
...
return (
<div>
...
{renderGraph && ( <SigmaContainer graph={rendergraph} ... ></SigmaContainer>)}
</div>
)
try to set the defaultNodeType
to image
on sigma settings
try to add the circle program on sigma settings
Thanks for your response and for looking into it. I figured it out and feel a bit silly.It was a version issue with react-sigma. While I had run an npm update, I was not using the latest versions, for whatever reason. Resolving that fixed the issue.
Thanks for your work on this great module. i am refactoring my code to use this module instead of the old react sigma module to render neo4j data. I use a reworked version of the neosig code to map the fields etc. I load the graph into a state and render this state so that the graph is rendered after the data is loaded and processed. I followed this example carefully to add images to nodes: https://github.com/sim51/react-sigma/issues/32
The graph renders fine unless I set type: image in the addNode function in which case I get the error:
code extracts below (full module is 450 lines but can share more as useful):
I have checked that my node add function is adding the type: image and image: url fields to node.attributes.
I'm struggling with how to diagnose this. I suppose the error could be an artifact of me loading the graph into the state then rendering the state value. But it could also be a bug.
Many thanks Ian