Contact us

Applies to: Customer's Canvas On-Premises; Customer's Canvas Hub cloud; UI Framework 4.0 - 4.47; Design Editor 7.0 - 7.4

Skip to main content

setViewerSettings

This command defines the canvas zoom and the scroll position of the visible area.

Params​

  • zoom: the zoom level, where 1 stands for 100%.
  • zoomMode: defines how the product fits the canvas: "none", "bestFit", "bestFitShrinkOnly", "fitToWidth", "fitToHeight", "zoomControl", "fitToWidthShrinkOnly", or "fitToHeightShrinkOnly".
  • scrollPosition: the X and Y coordinates of the visible area.

For the complete list of parameters, you can refer to IDesignEditorDefinitionSetViewerSettings.

Example​

{
"type": "design-editor",
"name": "editor",
"params": {
"initial": { ... },
"setViewerSettings": {
"zoom": 0.1,
"zoomMode": "bestFit",
"scrollPosition": { "x": 0, "y": 0 }
}
}
}
Was this page helpful?