Giter VIP home page Giter VIP logo

Comments (8)

dylanvorster avatar dylanvorster commented on May 4, 2024 1

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.

dylanvorster avatar dylanvorster commented on May 4, 2024

Hey, thanks for reaching out! mind jumping onto Gitter quickly?

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 4, 2024

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.

dylanvorster avatar dylanvorster commented on May 4, 2024

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.

mwozniczak avatar mwozniczak commented on May 4, 2024

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.

kriskrss avatar kriskrss commented on May 4, 2024

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.

dylanvorster avatar dylanvorster commented on May 4, 2024

Can I close this issue?

from react-diagrams.

kriskrss avatar kriskrss commented on May 4, 2024

Sure, I can create another one if I find that this is a bug :)

from react-diagrams.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.