Skip to content

Commit

Permalink
README update.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsfy committed Aug 1, 2016
1 parent 80db8fd commit 9e508fa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 37 deletions.
78 changes: 42 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,6 @@ Provides grapples to resize nodes.
![Image of extension](img.png)



## Dependencies

* Cytoscape.js ^2.7.0
* oCanvas ^2.8.0


## Usage instructions

Download the library:
* via npm: `npm install cytoscape-node-resize`,
* via bower: `bower install cytoscape-node-resize`, or
* via direct download in the repository (probably from a tag).

`require()` the library as appropriate for your project:

CommonJS:
```js
var cytoscape = require('cytoscape');
var nodeResize = require('cytoscape-node-resize');
var oCanvas = require('oCanvas');

nodeResize( cytoscape, jQuery, oCanvas ); // register extension
```

AMD:
```js
require(['cytoscape', 'cytoscape-node-resize', "jquery", "oCanvas], function( cytoscape, nodeResize, jQuery, oCanvas ){
nodeResize( cytoscape, jQuery, oCanvas ); // register extension
});
```
Plain HTML/JS has the extension registered for you automatically, because no `require()` is needed.
## API

Only consists of initilization & default options.
Expand All @@ -57,7 +22,14 @@ Only consists of initilization & default options.
boundingRectangle: true, // enable/disable bounding rectangle
boundingRectangleStroke: "1.5px red", // style bounding rectangle

minNodeSize: 15, // minimum width/height of node to be set
minWidth: function (node) {
var data = node.data("resizeMinWidth");
return data ? data : 15;
}, // a function returns min width of node
minHeight: function (node) {
var data = node.data("resizeMinHeight");
return data ? data : 15;
}, // a function returns min height of node

fixedAspectRatioResizeModeSelector: ".fixedAspectRatioResizeMode",// with only 4 active grapples (at corners)
noResizeModeSelector: ".noResizeMode", // no active grapples
Expand All @@ -79,6 +51,40 @@ Only consists of initilization & default options.
```


## Dependencies

* Cytoscape.js ^2.7.0
* oCanvas ^2.8.0


## Usage instructions

Download the library:
* via npm: `npm install cytoscape-node-resize`,
* via bower: `bower install cytoscape-node-resize`, or
* via direct download in the repository (probably from a tag).

`require()` the library as appropriate for your project:

CommonJS:
```js
var cytoscape = require('cytoscape');
var nodeResize = require('cytoscape-node-resize');
var oCanvas = require('oCanvas');

nodeResize( cytoscape, jQuery, oCanvas ); // register extension
```

AMD:
```js
require(['cytoscape', 'cytoscape-node-resize', "jquery", "oCanvas"], function( cytoscape, nodeResize, jQuery, oCanvas ){
nodeResize( cytoscape, jQuery, oCanvas ); // register extension
});
```

Plain HTML/JS has the extension registered for you automatically, because no `require()` is needed.


## Emitted Events
`cy.on("resizestart", function(e, type){ })`

Expand Down
2 changes: 1 addition & 1 deletion cytoscape-node-resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
minWidth: function (node) {
var data = node.data("resizeMinWidth");
return data ? data : 15;
}, // a function returns min with of node
}, // a function returns min width of node
minHeight: function (node) {
var data = node.data("resizeMinHeight");
return data ? data : 15;
Expand Down

0 comments on commit 9e508fa

Please sign in to comment.