Comments (13)
Hi, Thanks for looking into this. I have created a small example. When app is running clicking save, clear, load buttons reproduces the issue.
from react-diagrams.
Thanks for taking the time to do this, Ill jump onto this shortly and see what I can do.
from react-diagrams.
Fixed in 2.5.2
from react-diagrams.
does this still happen in the 2.4.8?
from react-diagrams.
Yes, it throws an error now "Cannot find Node Port element with nodeID:..."
It looks like just fired before the model was serialized.
I am making a request to a server and trying to serialize the model.
how code looks like
componentDidMount() {
API.httpGet('/stage')
.then((stageJson) => {
let model2 = new SRD.DiagramModel();
this.state.engine.setDiagramModel(model2);
model2.deSerializeDiagram(stageJson, this.state.engine);
subscribeModel(model2); //subscribe to model events
this.setState({model:model2});
_.each(model2.getNodes(),subscribeNode.bind(this)); //subscribe to node events
this.forceUpdate()
});
}
from react-diagrams.
I had the same error. I created a new LinkWidget
and LinkFactory
. I'm searching where can be the problem.
from react-diagrams.
I a workaround that I made is reimporting 2 times, with a timeout of 100 milliseconds.
serializationImport() {
try {
// Parse the JSON
let object = JSON.parse(this.state.serializationInput);
// Create a new Model
let newModel = new SRD.DiagramModel();
newModel.deSerializeDiagram(object, this.engine);
// Render the `newModel`
this.model = newModel;
this.engine.setDiagramModel(newModel);
this.forceUpdate();
this._tempTimeout = setTimeout(() => {
this.serializationImport();
clearTimeout(this._tempTimeout);
}, 100);
} finally {
this.toggleSerializationModal();
}
}
from react-diagrams.
I have a similar issue. I am using default factories. When I deserialize the diagram with a new engine and empty model links don't get created with an error like
Cannot find Node Port element with nodeID: [1e0a6c3f-592b-49ab-a953-0b8eb67e1a55] and name: [sensorValue]
If I deserialize the model twice links appear. Probably something to do with deserialization order. Nodes need to be created before the links are created. I can see this in the logs as well, first links are added and then removed due to the node not found error message.
from react-diagrams.
arghhh race conditions :C If you can provide me with a test case ill try fix it
from react-diagrams.
Any update on this?
from react-diagrams.
Hold on, I think I got it. I'll send a PR in a few minutes.
from react-diagrams.
I think this is fixed in PR #80 , can anyone confirm?
from react-diagrams.
Fixed in caadbf4
from react-diagrams.
Related Issues (20)
- custom code
- [Bug] Right angled links are diagonal if the points are added after the link is created
- 50 Errors in build HOT 2
- BezierCurve
- Tutorial not working HOT 1
- Deserialization not working HOT 2
- Demos should be refactored to be consistent with modern react standards and styles HOT 2
- I can't see the any nodes. HOT 1
- Is there a way with smart routing to ensure that the link line is never going through the node?
- Deregister Listener when links are created
- DragNewLinkState bug when pressing down with another mouse button while dragging.
- Does storm-react-diagrams support nonce attribute for CSP?
- Node EventListeners don't work when setting a state from component
- can't find createEngine export HOT 1
- Adding NodeModel to NodeLayer set itself as its parent, but NodeModel's parent must be a Diagram
- Module '"@projectstorm/react-diagrams"' has no exported member 'AbstractReactFactory'.
- Intermittent bug in dragNewLink with allowLooseLinks = false HOT 2
- [Question] How can I drag connection that already connected?
- Deserialization isn't working properly HOT 1
- got an error in gallary demo: diagrams-demo-gallery HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-diagrams.