cytoscape-panzoom
Advanced tools
Comparing version 2.1.2 to 2.1.3
{ | ||
"name": "cytoscape-panzoom", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "Panzoom extension for Cytoscape.js", | ||
@@ -5,0 +5,0 @@ "main": "cytoscape-panzoom.js", |
{ | ||
"name": "cytoscape-panzoom", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "Panzoom extension for Cytoscape.js", | ||
@@ -5,0 +5,0 @@ "main": "cytoscape-panzoom.js", |
@@ -11,5 +11,3 @@ cytoscape-panzoom | ||
Note that because this plugin is unnecessary on touch devices due to natural gesture support, it is disabled by default on touch devices. The plugin wouldn't be very useful anyway on touch, because small targets are much harder to use than gestures that can be used anywhere. As such, the plugin is untested on touch and would probably either need a library like [fastclick](https://github.com/ftlabs/fastclick) or reworking of its event handlers to work. | ||
## Dependencies | ||
@@ -54,23 +52,23 @@ | ||
// the default values of each option are outlined below: | ||
var defaults = ({ | ||
zoomFactor: 0.05, // zoom factor per zoom tick | ||
zoomDelay: 45, // how many ms between zoom ticks | ||
minZoom: 0.1, // min zoom level | ||
maxZoom: 10, // max zoom level | ||
fitPadding: 50, // padding when fitting | ||
panSpeed: 10, // how many ms in between pan ticks | ||
panDistance: 10, // max pan distance per tick | ||
panDragAreaSize: 75, // the length of the pan drag box in which the vector for panning is calculated (bigger = finer control of pan speed and direction) | ||
panMinPercentSpeed: 0.25, // the slowest speed we can pan by (as a percent of panSpeed) | ||
panInactiveArea: 8, // radius of inactive area in pan drag box | ||
panIndicatorMinOpacity: 0.5, // min opacity of pan indicator (the draggable nib); scales from this to 1.0 | ||
autodisableForMobile: true, // disable the panzoom completely for mobile (since we don't really need it with gestures like pinch to zoom) | ||
// icon class names | ||
sliderHandleIcon: 'fa fa-minus', | ||
zoomInIcon: 'fa fa-plus', | ||
zoomOutIcon: 'fa fa-minus', | ||
resetIcon: 'fa fa-expand' | ||
}); | ||
var defaults = { | ||
zoomFactor: 0.05, // zoom factor per zoom tick | ||
zoomDelay: 45, // how many ms between zoom ticks | ||
minZoom: 0.1, // min zoom level | ||
maxZoom: 10, // max zoom level | ||
fitPadding: 50, // padding when fitting | ||
panSpeed: 10, // how many ms in between pan ticks | ||
panDistance: 10, // max pan distance per tick | ||
panDragAreaSize: 75, // the length of the pan drag box in which the vector for panning is calculated (bigger = finer control of pan speed and direction) | ||
panMinPercentSpeed: 0.25, // the slowest speed we can pan by (as a percent of panSpeed) | ||
panInactiveArea: 8, // radius of inactive area in pan drag box | ||
panIndicatorMinOpacity: 0.5, // min opacity of pan indicator (the draggable nib); scales from this to 1.0 | ||
zoomOnly: false, // a minimal version of the ui only with zooming (useful on systems with bad mousewheel resolution) | ||
// icon class names | ||
sliderHandleIcon: 'fa fa-minus', | ||
zoomInIcon: 'fa fa-plus', | ||
zoomOutIcon: 'fa fa-minus', | ||
resetIcon: 'fa fa-expand' | ||
}; | ||
cy.panzoom( defaults ); | ||
@@ -77,0 +75,0 @@ ``` |
588710
83