0.4.3 • Published 5 years ago

zoom-zone v0.4.3

Weekly downloads
272
License
MIT
Repository
github
Last release
5 years ago

zoom-zone Build Status Ember Observer Score

An Ember component providing a region which can be panned and zoomed.

Installation

  • ember install zoom-zone

Use

This addon provides a component called zoom-zone. This component presents a region than can be panned and zoomed with gestures.

{{#zoom-zone}}
  <img src="http://placehold.it/300x200" width='300' height='200'>
  {{#link-to 'foo'}}<span class='splorch' id='foo'></span>{{/link-to}}
{{/zoom-zone}}

The component will yield itself as the first argument to its block if one is specified.

The following properties are supported in the zoom-zone component

PropertyReadWriteDefaultPurpose
headerTemplatenullSets a partial to render within the component (so these properties are available), but before the viewport
footerTemplatenullAs above, but after the viewport
activeViewporttrueIf set, the viewport will be able to pan and zoom as well
minScale0.1The minimum zoom level
maxScale5.0The maximum zoom level
increment0.1The amount the zoom increments by in the actions (see below)
scale"zoom-to-fit"The zoom level (Note that zooming to fit will adjust the panning as well)
panX0The x offset of the content in the viewport
panY0The y offset of the content in the viewport
centerOnFittrueIf set, the content will be centered in the viewport when zooming to fit
delay250msA duration (in ms) to animate zooming caused by the zoomIn and zoomOut events
originalWidthWidth of contentThe original width of the zoomed content
originalHeightHeight of contentThe original height of the zoomed content
widthThe current width of the zoomed content
heightThe current height of the zoomed content

These actions are available:

  • zoomTo(scale): Sets the scale to the passed argument (defaults to 1)
  • zoomIn: Increases the scale by the increment
  • zoomOut: Decreases the scale by the increment
  • zoomFit: Sets the scale to the largest value which does fits in both dimensions. Pans such that the entire content is within the viewport (either centered or aligned to the top left based on the value of centerOnFit)

For more information on using ember-cli, visit http://www.ember-cli.com/.

License

This project is licensed under the MIT License.

0.4.3

5 years ago

0.4.2

5 years ago

0.3.3

5 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago