## module:ViewBox(left, top, width, height)

ViewBox provides an api for oprerating with the viewBox argument of the

#### new module:ViewBox(left, top, width, height)
`modules/ui/ViewBox.js`, `line 5`

  Initialize viewBox

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `left` | number | distance of the left edge of the viewbox from document's y axis in SVG pixels
  `top` | number | distance of the top edge of the viewbox from the document's x axis in SVG pixels
  `width` | number | width of the viewbox in SVG pixels
  `height` | number | height of the viewbox in SVG pixels

### Members

#### height
`modules/ui/ViewBox.js`, `line 103`

  get the height of the viewbox with the current zoom applied

#### left
`modules/ui/ViewBox.js`, `line 111`

  get the horizontal distance from the y axis of the document with zoom and shift value applied

#### leftShift :number
`modules/ui/ViewBox.js`, `line 41`

  amount of horizontal shift of the document

#### maxZoom :number
`modules/ui/ViewBox.js`, `line 24`

  The maximum amount of zoom on the viewbox

#### minZoom :number
`modules/ui/ViewBox.js`, `line 29`

  The minimum amount of zoom on the viewbox

#### real :object
`modules/ui/ViewBox.js`, `line 18`

  ViewBox attributes before applying zoom and shift

#### realZoom :number
`modules/ui/ViewBox.js`, `line 35`

  Amount of zoom on the viewbox, always between this.minZoom and this.maxZoom

#### str
`modules/ui/ViewBox.js`, `line 127`

  get the computed viewbox values as a string in the correct format that can be used in the viewBox attribute of the SVG element

#### top
`modules/ui/ViewBox.js`, `line 119`

  get the vertical distance from the x axis of the document with zoom and shift value applied

#### topShift :number
`modules/ui/ViewBox.js`, `line 46`

  amount of vertical shift of the document

#### width
`modules/ui/ViewBox.js`, `line 95`

  get the width of the viewbox with the current zoom applied

#### zoom
`modules/ui/ViewBox.js`, `line 78`

  get the amount of zoom on the viewbox

#### zoom
`modules/ui/ViewBox.js`, `line 86`

  set the amount of zoom on the viewbox

### Methods

#### move(left, top)
`modules/ui/ViewBox.js`, `line 69`

  apply viewbox movement and take the zoom into account

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `left` | number | horizontal movement
  `top` | number | vertical movement

#### newDimensions(width, height)
`modules/ui/ViewBox.js`, `line 54`

  update the dimensions of the viewbox (used on window resize)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `width` | Number | new width of the viewbox in SVG pixels
  `height` | Number | new height of the viewbox in SVG pixels

#### transformEvent(event) → {jquery.MouseEvent}
`modules/ui/ViewBox.js`, `line 154`

  transform pageX and pageY parameters of the jquery event to match the zoom and shift of the viewbox

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `event` | jquery.MouseEvent | original event

  ##### Returns:

  jquery.MouseEvent -

  the same event but with transformed pageX and pageY members

#### transformX(x) → {number}
`modules/ui/ViewBox.js`, `line 136`

  transform horizontal units to the scale and shift of the editor

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `x` | number | original horizontal value

  ##### Returns:

  number -

  transformed horizontal value

#### transformY(y) → {number}
`modules/ui/ViewBox.js`, `line 145`

  transform vertical units to the scale and shift of the editor

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `y` | number | original vertical value

  ##### Returns:

  number -

  transformed vertical value