Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Control points are not set when node is moved along with attached label (Read 816 times)
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3343
Joined: Oct 19th, 2005
Re: Control points are not set when node is moved along with attached label
Reply #15 - Nov 11th, 2024 at 3:43pm
Print Post  
Hi Kannan,

I guess the 'ths' variable used in your replacement function does not refer to a link, and you should just use the 'this' keyword. Please follow the pattern shown here to replace prototype functions, including passing this to original function via apply method:

https://mindfusion.eu/Forum/YaBB.pl?num=1727952105/3#3

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


I Love Mind Fusion Diagram
:-)

Posts: 284
Location: Bangalore, India
Joined: Jan 18th, 2019
Re: Control points are not set when node is moved along with attached label
Reply #16 - Nov 12th, 2024 at 5:14am
Print Post  
Hi Slavcho,

I think that "ths" seems fine. But I've called the override function updateFromPoints in a wrong way. I've called as ths.updateFromPoints2() but it should be called as this.updateFromPoints2.apply(this). Below is the modified code. I hope this is correct. Thank you for the suggestion Smiley


        var ths = this;

        var originalUpdateFromPoints = DiagramLink.prototype.updateFromPoints;

        DiagramLink.prototype.updateFromPoints = function () {
          originalUpdateFromPoints.apply(this);
          ths.consoleLinkPoints(this, "On updateFromPoints");
        };

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


I Love Mind Fusion Diagram
:-)

Posts: 284
Location: Bangalore, India
Joined: Jan 18th, 2019
Re: Control points are not set when node is moved along with attached label
Reply #17 - Nov 18th, 2024 at 6:05am
Print Post  
Hi Slavcho,

As I said before, we are using these mind fusion packages: "diagram-library": "3.5.7" and "mindfusion-common": "^1.2.6"

Earlier you asked me to use https://www.npmjs.com/package/@mindfusion/diagramming.

Is this one package is enough to replace the above two packages?

Regards,
Kannan

Slavcho wrote on Nov 8th, 2024 at 6:44am:
Hi Kannan,

That is 4-5 years old now. We have moved our libraries to a @mindfusion npm scope, the diagram is here -

https://www.npmjs.com/package/@mindfusion/diagramming

linkModified is raised only when user drags link's control point directly and won't fire for changes done by router. You might be able to detect changes done by automatic layouts and routers by replacing DiagramLink.prototype.updateFromPoints method with your own function, and updating database from it.

Regards,
Slavcho
Mindfusion

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3343
Joined: Oct 19th, 2005
Re: Control points are not set when node is moved along with attached label
Reply #18 - Nov 18th, 2024 at 8:57am
Print Post  
Hi Kannan,

That package automatically pulls dependencies (https://www.npmjs.com/package/@mindfusion/diagramming?activeTab=dependencies) that were in the 'common' library previously.

In version 4 you'd be creating a DiagramView component for the DOM canvas element instead of Diagram, and setting zoom, behavior and scroll properties on the DiagramView. We have also moved to property syntax, but you can keep calling setter functions by enabling this option:

Code
Select All
MindFusion.Diagramming.CompatConfig.propFunctions = true; 



https://www.mindfusion.eu/onlinehelp/jsdiagram/Moving_to_version_4.htm

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