Git Product home page Git Product logo

Comments (24)

dylanvorster avatar dylanvorster commented on May 2, 2024 14

So grouped nodes are an interesting topic. I would like to implement something similar to: https://ni.i.lithium.com/t5/image/serverpage/image-id/68375i4C76101D2548C8AA?v=1.0 but I have not done it yet because its a little bit more involved:

  1. firstly, I want group nodes to move their children. We can do this by having a new GroupNode which allows you to add child nodes, and when the translate method fires on the group, it can apply offsets to each descendant. The problem is that this logic is handled in the MoveEvent inside the DiagramWidget, so the logic would need to rather be implement there, as apposed to the model. Its actually not too difficult to do, but I have an idea in mind that relates to 'when any model is going to be moved, every model that is being moved, should be able to return an array of items including itself that need to be translated'. With this, implementing groups would be a relatively trivial task.

  2. I want groups to be infinitely nest-able, but as mentioned in the previous point, this would be possible as a result.

  3. I want groups to be collapsable, but that requires grouped elements which would hide, to have a visibility identifier. It would also require links that are connected to the elements which would hide, to rather connect to a temporary port that is at the center of the collapsed node. This however would need to NOT reflect in the model because it is purely a visual change, and not a change that should change which ports the link point to (even if it is temporary). So that particular feature would need to be implemented in the DiagramWidget code.

Groups are cool, but I've been thinking about the best, multi-functional way to do this that is more correct rather than just a hack. You are welcome to try implement it, but I at least am going to need some time to refine some of the concepts/finer implementation details before I could make this a reality.

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024 8

I don't really want to handle groups as top level because groups can be nested. Im going to introduce a new type of node that is a group with addNode and removeNode on it. The nodes will then be an array of id's on the group that gets serialized.

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024 6

I have sort of started working on this, you can read all about it here: http://dylanv.blog/2017/09/13/storm-react-diagrams-v3/

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024 6

<3 matrix transformations

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024 5

2019 and I finally got around to implementing the foundations for this feature in version 6 x_x.

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024 4

https://github.com/projectstorm/react-canvas Its finally happening :D

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024 3

Hey everyone, thought I would post an update here. Whats actually happening is probably the biggest and most important refactor of this library: storm-react-canvas. I am rewriting the entire library into two separate projects. storm-react-canvas which is closer to a graphics system such as in-design/quark-express and react-diagrams which will use this graphics system but reap the benefits of react-canvas. While developing group nodes, it became increasingly clear that we need a lot more capability that provides: resizing, grouping elements, multiple layers, better event handling and amongst other things, a better way to deterministically test the system if we want to support advanced features like this. I've been working on this solidly for the past week and I have a semi-working system up and running that can cater for all this but it is not quite ready for prime-time just yet. The second its ready, I will be creating a new project in the projectstorm organization and will open up a new branch in this library which will start making use of this base.

from react-diagrams.

Letrab avatar Letrab commented on May 2, 2024 3

This would be really awesome!

@dylanvorster : Any guides on how we can contribute to this?
Thanks!

from react-diagrams.

Timopheym avatar Timopheym commented on May 2, 2024 2

@dylanvorster hey, thanks you so much for the library, when do you plan to introduce this? We having quite complex application for react-diagrams and this feature is very important for us. Will it be soon or is it more reasonable to do it by our own?
From my vision it should also have a widget that will show inner graph on big zoom and on zoom out it could show some icon f.e.
Thanks.

from react-diagrams.

kfrajtak avatar kfrajtak commented on May 2, 2024 2

Great work! Can I suggest to include a playbook example whenever a feature like this is added? Also, can the playbook page contain some additional information or source code to describe what's going and how can I use it in my project without looking into the source code? Something like a "1.000ft" view documentation.

from react-diagrams.

gen4sp avatar gen4sp commented on May 2, 2024

Groups are cook and are essential )

I think groups should be like this:

{
"id": "f94a9a46-9ce3-49aa-8ecf-b4c74a86d283",
  "offsetX": 0,
  "offsetY": 0,
  "zoom": 100,
  "links": [{},{}],
  "nodes": [{
      id:'0',
      type:'default',
      ports:[{},{}]
},{
      id:'1',
      type:'group',
      ports:[{},{}]
}],
  "groups": [{
      id:1,
      "offsetX": 0,
      "offsetY": 0,
      "zoom": 100,
      "links": [{},{}],
      "nodes": [{
            id:2,
            type:'group',
            ports:[{},{}]
      },
      id:2,
      "offsetX": 0,
      "offsetY": 0,
      "zoom": 100,
      "links": [{},{}],
      "nodes": [{
            id:3,
            type:'default',
            ports:[{},{}]
      }]
}

the root level contains only nodes and group-nodes with only id and ports. All content of groups described in flat (not nested) array "groups".
But groups could be nested of corse (see example - group1 contains group2)

so root element and each group contains only elements to render and dont contains deeper elements

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024

@Timopheym Due to my own circumstances, I don't really have the need just yet for this feature, or the time to implement it properly. It would probably best if you could implement this yourself. It goes without saying though, that I'm fully open to pull requests :)

from react-diagrams.

cemremengu avatar cemremengu commented on May 2, 2024

Any examples on group nodes? Is it still WIP?

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024

Still need to get around to implementing a group widget, but would like to point out that using and overriding this method will allow moving a single node the ability to tell the system what other nodes should be moved:

getSelectedEntities() {

from react-diagrams.

cemremengu avatar cemremengu commented on May 2, 2024

Thanks for your work! The use case for grouping for me is to show a link from the group itself to another group. So that it is possible to define a group based connection in addition to individual nodes inside the group.

So I guess, group is just another node with in/out ports that can have other nodes inside it.

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024

@cemremengu exactly right

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024

I have started work on this although its incredibly incomplete: #203

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024

screen shot 2018-03-26 at 17 38 56

from react-diagrams.

dylanvorster avatar dylanvorster commented on May 2, 2024

update:



from react-diagrams.

tabdon avatar tabdon commented on May 2, 2024

Hi @dylanvorster react-canvas is looking great. Is there a way to use the work you've done on it so far with react-diagram?

from react-diagrams.

Timopheym avatar Timopheym commented on May 2, 2024

2019 and I finally got around to implementing the foundations for this feature in version 6 x_x.

We are still waiting! It would be great! How can we help you?

from react-diagrams.

arthuryeti avatar arthuryeti commented on May 2, 2024

@dylanvorster do you need help to release this?

from react-diagrams.

sudha53633 avatar sudha53633 commented on May 2, 2024

@dylanvorster

Great work! When can we see the release of group nodes feature , kindly help us here

from react-diagrams.

realleocaster avatar realleocaster commented on May 2, 2024

@dylanvorster awesome work! Any update on the group nodes? How can we help?

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.