cytoscape-grid-guide
Advanced tools
Comparing version
{ | ||
"name": "cytoscape-grid-guide", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "A sophisticated and highly customizable Cytoscape.js extension for grid and guideline interactions.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -6,3 +6,5 @@ cytoscape-grid-guide | ||
<img src="guideline-example.png" width="300"> | ||
| Guideline example | Grid example | | ||
| ------------- | ------------- | | ||
|<img src="guideline-example.png" width="300"> | <img src="grid-example.png" width="300">| | ||
@@ -9,0 +11,0 @@ A sophisticated and highly customizable Cytoscape.js extension for grid and guideline interactions, distributed under [The MIT License](https://opensource.org/licenses/MIT). The following features are provided: |
@@ -15,2 +15,16 @@ module.exports = function (opts, cy, $, debounce) { | ||
var resetCanvas = function () { | ||
$canvas | ||
.attr('height', 0) | ||
.attr('width', 0) | ||
.css( { | ||
'position': 'absolute', | ||
'top': 0, | ||
'left': 0, | ||
'z-index': options.gridStackOrder | ||
}); | ||
}; | ||
resetCanvas(); | ||
var drawGrid = function() { | ||
@@ -92,2 +106,3 @@ var zoom = cy.zoom(); | ||
resizeCanvas: resizeCanvas, | ||
resetCanvas: resetCanvas, | ||
clearCanvas: clearDrawing, | ||
@@ -94,0 +109,0 @@ drawGrid: drawGrid, |
@@ -99,3 +99,2 @@ module.exports = function (cy, snap, resize, snapToGridDuringDrag, drawGrid, guidelines, parentPadding, $, opts) { | ||
cy[eventStatus(enable)]('pan', drawGridOnPan); | ||
cy[eventStatus(enable)]('ready', drawGrid.resizeCanvas); | ||
@@ -107,2 +106,3 @@ if (enable) { | ||
drawGrid.clearCanvas(); | ||
drawGrid.resetCanvas(); | ||
$(window).off('resize', drawGrid.resizeCanvas); | ||
@@ -163,2 +163,3 @@ } | ||
cy.off("free", guidelinesFreeHandler); | ||
guidelines.resetCanvas(); | ||
$(window).off("resize", guidelinesWindowResizeHandler); | ||
@@ -165,0 +166,0 @@ } |
@@ -63,4 +63,17 @@ module.exports = function (opts, cy, $, debounce) { | ||
$container.append($canvas); | ||
resizeCanvas(); | ||
var resetCanvas = function () { | ||
$canvas | ||
.attr('height', 0) | ||
.attr('width', 0) | ||
.css( { | ||
'position': 'absolute', | ||
'top': 0, | ||
'left': 0, | ||
'z-index': options.gridStackOrder | ||
}); | ||
}; | ||
resetCanvas(); | ||
/* Global variables */ | ||
@@ -1007,3 +1020,4 @@ var VTree = null; | ||
resizeCanvas: resizeCanvas, | ||
resetCanvas: resetCanvas, | ||
} | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
257838
26.39%19
11.76%4706
1.12%156
1.3%