You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix would be to copy the camera state if an instance exists already, and set it to the new instance's camera right after it's created. Something like:
constcameraState=instance ? instance.getCamera().getState() : null;// [...] existing code that remounts the instanceif(cameraState)instance.getCamera().setState(cameraState);
The text was updated successfully, but these errors were encountered:
Details:
- Positions are no more always rescaled to fit in the screen at default
camera (this is done using some Sigma#setCustomBBox magic)
- Nodes and edges sizes are now always in the same coordinates system as
the nodes positions (thanks to sigma-3.0.0alpha3)
- SigmaGraph is not fully respawned when its dependencies are updated,
the instance is preserved instead (because of
sim51/react-sigma#48)
When a new
graph
prop value is given to someSigmaContainer
instance, the camera is reset. I was expecting the camera to remain the same.The reason is visible here:
react-sigma/project/packages/core/src/components/SigmaContainer.tsx
Lines 82 to 86 in 9b55729
The fix would be to copy the camera state if an instance exists already, and set it to the new instance's camera right after it's created. Something like:
The text was updated successfully, but these errors were encountered: