We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Zooming for ejs-diagram

Thread ID:

Created:

Updated:

Platform:

Replies:

150782 Jan 20,2020 05:49 AM UTC Jan 22,2020 07:14 AM UTC Angular - EJ 2 3
loading
Tags: Diagram
SaiSravya
Asked On January 20, 2020 05:49 AM UTC

I want to enable zooming option for ejs-diagram


The zooming which you provided is as below


It is with ejs-chart

I need to do the same for ejs-diagram


Please help me on this... 

Shyam G [Syncfusion]
Replied On January 21, 2020 06:36 AM UTC

Hi SaiSravya, 

By default, the Zooming is enabled in the diagram. We need not set any properties to enable the zooming in the diagram. To disable the zoom initially, we should remove DiagramConstraints Zoom from the Default. Also, we can use zoomTo method to perform zoom operations at runtime. Please refer to a code example below. 

Code example: 
//disable zoom initially 
public constraints: DiagramConstraints = DiagramConstraints.Default &~DiagramConstraints.Zoom;   

  
//zoom operation at runtime 
ZoomIn() { 
    let zoomOptions: ZoomOptions = { 
      type: "ZoomIn", 
      //Sets the factor by which we can zoom in or zoom out 
      zoomFactor: 0.5 
    } 
    //zoomin the diagram 
    this.diagram.zoomTo(zoomOptions) 
 
  } 
 
  ZoomOut() { 
    let zoomOptions: ZoomOptions = { 
      type: "ZoomOut", 
      //Sets the factor by which we can zoom in or zoom out 
      zoomFactor: 0.5 
    } 
    //zoomout the diagram 
    this.diagram.zoomTo(zoomOptions) 
  } 


Regards, 
Shyam G 


SaiSravya
Replied On January 21, 2020 12:57 PM UTC

Do we need to import [zoomSettings] function to html?


If yes, Please share the details

Shyam G [Syncfusion]
Replied On January 22, 2020 07:14 AM UTC

Hi SaiSravya, 

No, we need not import any function to html. 

Regards, 
Shyam G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon