Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram Events ! (Read 2849 times)
Kannan Thirumal
Senior Member
****
Offline


I Love Mind Fusion Diagram
:-)

Posts: 270
Location: Bangalore, India
Joined: Jan 18th, 2019
Diagram Events !
Oct 18th, 2019 at 11:50am
Print Post  
Hi,

      I've subscribed to Event.nodeModified and Event.linkModified events. When a node is moved, Event.nodeModified is called. If a link is moved, Event.linkModified is called. When a node is moved links also gets modified in the UI, but Event.linkModified is not called. Is this the correct behavior?

Regards,
Kannan
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Diagram Events !
Reply #1 - Oct 21st, 2019 at 6:43am
Print Post  
Hi,

Correct or not, that's how these events have been working in our various platforms for many years; let's say it's more of a gray area Smiley If you need to treat direct and indirect modifications of a link in same way, I guess loop over node's links and call your link-specific handler for each one.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Kannan Thirumal
Senior Member
****
Offline


I Love Mind Fusion Diagram
:-)

Posts: 270
Location: Bangalore, India
Joined: Jan 18th, 2019
Re: Diagram Events !
Reply #2 - May 11th, 2020 at 7:32am
Print Post  
Hi,

I've subscribed to nodeModifying event like this. When one node is selected and moved, this event is called but more than one node is selected and moved, nodeModifying event is not called. May I know why?

    this.diagram.addEventListener(Event.nodeModifying, (sender, args) => {

      var canvasBounds = sender.getBounds() as Rect;
      var nodeBounds = args.node.getBounds() as Rect;

      if (nodeBounds.x < canvasBounds.x || nodeBounds.y < canvasBounds.y) {
        args.setCancel(true);
      }
    });

Regards,
Kannan
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Diagram Events !
Reply #3 - May 11th, 2020 at 3:57pm
Print Post  
Hi,

There's the selectionModifying event raised when there are multiple items being moved or resized.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Kannan Thirumal
Senior Member
****
Offline


I Love Mind Fusion Diagram
:-)

Posts: 270
Location: Bangalore, India
Joined: Jan 18th, 2019
Re: Diagram Events !
Reply #4 - May 12th, 2020 at 6:29am
Print Post  
Hi Slavcho,

It works fine. Thank you!

Regards,
Kannan
  
Back to top
 
IP Logged
 
Kannan Thirumal
Senior Member
****
Offline


I Love Mind Fusion Diagram
:-)

Posts: 270
Location: Bangalore, India
Joined: Jan 18th, 2019
Re: Diagram Events !
Reply #5 - Sep 3rd, 2020 at 5:36pm
Print Post  
Hi,

I've a different scenario like below,

* There are 3 nodes. In that 2 nodes are connected by a link (Attached Image - Link Before Node Move.png)
* Now, 3rd node is drag and dropped over the link (Attached Image - Link After Node Move.png)

Now the link got adjusted but the nodeModified event raised for the 3rd node but not able to capture the changes of the link.

May I know how to handle this?

Regards,
Kannan

Slavcho wrote on Oct 21st, 2019 at 6:43am:
Hi,

Correct or not, that's how these events have been working in our various platforms for many years; let's say it's more of a gray area Smiley If you need to treat direct and indirect modifications of a link in same way, I guess loop over node's links and call your link-specific handler for each one.

Regards,
Slavcho

  

Link_Before_Node_Move.png ( 56 KB | 100 Downloads )
Link_Before_Node_Move.png
Link_After_Node_Move.png ( 57 KB | 95 Downloads )
Link_After_Node_Move.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Diagram Events !
Reply #6 - Sep 4th, 2020 at 11:07am
Print Post  
Hi,

On other platforms of ours that would raise LinkRouted event, but seems it's not available in JS version. We'll have it in mind for next release.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint