Comments (8)
lastly, theres another cool guy thats using this project and is doing something similar, but he added text fields to the nodes themselves, for an example on how he is doing it you might find this interesting:
https://github.com/mwozniczak/adventure-weave/blob/master/src/widgets/SceneNodeWidget.tsx#L51
from react-diagrams.
Hey, thanks for reaching out! mind jumping onto Gitter quickly?
from react-diagrams.
its really strange that the links are getting deleted. The only time the system will delete the links, is if the ports happen to change, and so the links can no longer be connected. So I'm concerned that the model you are mutating is not the same model that the diagram engine is using. You should DEFINITELY be able to mutate the model and then repaint. You can also control what gets repainted down the whole tree by calling:
//first call this and pass in an array of models that you want to change
diagramEngine.enableRepaintEntities(entities: BaseModel<BaseModelListener>[]);
//then
diagramEngine.repaintCanvas() or forceUpdate() in your wrapper component
//and then finally
diagramEngine.clearRepaintEntities();
from react-diagrams.
to find out why the links are being deleted, take a look at this line:
https://github.com/projectstorm/react-diagrams/blob/master/src/widgets/LinkLayerWidget.ts#L49
as well as
https://github.com/projectstorm/react-diagrams/blob/master/src/widgets/LinkLayerWidget.ts#L60
from react-diagrams.
Yeah, I was just about gonna jump in here and toot my own horn for a minute there*, you beat me to it :D
@kriskrss you might wanna look at what @dylanvorster linked to, in particular what I'm doing with the composites.
Anyway, a potential workaround if the above doesn't work for you, might be have the title a new property of your NodeModel, and just render that in the widget.
*jeez i hope this is the right expression
from react-diagrams.
Thanks for the quick response!, I am building a redux app around this. So trying to make sure the model transitions also go through the redux dispatcher-reducer framework.
I was storing the model in my state and re-drawing on a new engine every time.
From what you guys mentioned, may be its better to just store the engine instead.
Will let you know how it goes.
Thanks guys!
from react-diagrams.
Can I close this issue?
from react-diagrams.
Sure, I can create another one if I find that this is a bug :)
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.