Is it possible to programmatically move focus to another node in overview component?

Is it possible to programmatically by some function move the focus to a certain node using overview component zoom options?

Best regards
Jiway S.A.

3 Replies

SG Shyam G Syncfusion Team November 20, 2019 07:09 AM UTC

Hi Jiway, 

Please use the bringToCenter diagram method to focus and bring the node to the center of the viewport. We have created a sample where you can select a node and click on the button bringToCenter to take the node to the viewport center. Please refer to a code example and sample below. 
 
Code example: 
  bringToCenter() {  
        var node = diagramInstance.selectedItems.nodes[0]; 
        if (node) { 
            //bring the selected node to center 
            diagramInstance.bringToCenter({ x: node.offsetX, y: node.offsetY, width:node.width, height: node.height}); 
        } 
}  
 
 
 

Regards, 
Shyam G 



DT Dominique Toussaint November 20, 2019 08:07 AM UTC

Hi Shyam G,

thanks, it works, such a great functionality.

Best regards,
Jiway S.A.


SG Shyam G Syncfusion Team November 20, 2019 08:35 AM UTC

Hi Jiway, 
Thanks for your update. 
Regards, 
Shyam G 


Loader.
Up arrow icon