Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic 1) Node move as per scrolling. (Read 2150 times)
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
1) Node move as per scrolling.
Dec 27th, 2017 at 6:51am
Print Post  
We need to create node in such way that, it will move as per scrolling the diagram.
Image1.png:  Initial diagram in which Node: 1 has set above property.
When we scroll-down the diagram then Node: 1 position changes as per scolling.

How to achieve this?
  

Image1.png ( 61 KB | 140 Downloads )
Image1.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3146
Joined: Oct 19th, 2005
Re: 1) Node move as per scrolling.
Reply #1 - Dec 27th, 2017 at 8:06am
Print Post  
There's Diagram.onScroll member function called when users scroll, you could inject your code there to move some nodes -

Code
Select All
var scrollHandler = Diagram.prototype.onScroll;
Diagram.prototype.onScroll = function()
{
    scrollHandler.apply(this);
    fixedNode.setBounds(...);
} 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Re: 1) Node move as per scrolling.
Reply #2 - Jan 3rd, 2018 at 2:04pm
Print Post  
This code not working a t my side.
I am using angular 2 to develop my application.
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: 1) Node move as per scrolling.
Reply #3 - Jan 4th, 2018 at 7:06am
Print Post  
Hi,

You can use the module augmentation technique in TypeScript to expose the private onScroll member to your API. Like this:

Code (Javascript)
Select All
declare module MindFusion.Diagramming
{
    interface Diagram
    {
        onScroll(): void;
    }
}

// now onScroll can be overriden in code like in the example above
var scrollHandler = Diagram.prototype.onScroll;
Diagram.prototype.onScroll = function()
{
    scrollHandler.apply(this);
    fixedNode.setBounds(...);
} 



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