Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to specify enabled grapples #46

Open
wants to merge 21 commits into
base: unstable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Dogrusoz"
given-names: "Ugur"
orcid: "https://orcid.org/0000-0002-7153-0784"
- family-names: "Karacelik"
given-names: "Alper"
orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Safarli"
given-names: "Ilkin"
- family-names: "Balci"
given-names: "Hasan"
orcid: "https://orcid.org/0000-0001-8319-7758"
- family-names: "Dervishi"
given-names: "Leonard"
- family-names: "Siper"
given-names: "Metin Can"
title: "cytoscape-node-editing"
version: 4.1.0
date-released: 2021-06-16
url: "https://github.com/iVis-at-Bilkent/cytoscape.js-node-editing"
preferred-citation:
type: article
authors:
- family-names: "Dogrusoz"
given-names: "Ugur"
orcid: "https://orcid.org/0000-0002-7153-0784"
- family-names: "Karacelik"
given-names: "Alper"
orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Safarli"
given-names: "Ilkin"
- family-names: "Balci"
given-names: "Hasan"
orcid: "https://orcid.org/0000-0001-8319-7758"
- family-names: "Dervishi"
given-names: "Leonard"
- family-names: "Siper"
given-names: "Metin Can"
doi: "10.1371/journal.pone.0197238"
journal: "PLOS ONE"
month: 5
start: 1 # First page number
end: 18 # Last page number
title: "Efficient methods and readily customizable libraries for managing complexity of large networks"
issue: 5
volume: 13
year: 2018
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ U. Dogrusoz , A. Karacelik, I. Safarli, H. Balci, L. Dervishi, and M.C. Siper, "

## Demo

Click [here](https://raw.githack.com/iVis-at-Bilkent/cytoscape.js-node-editing/unstable/demo.html) (simple) or [here](https://raw.githack.com/iVis-at-Bilkent/cytoscape.js-node-editing/unstable/undoable_demo.html) (undoable) for demos
Click [here](https://ivis-at-bilkent.github.io/cytoscape.js-node-editing/demo.html) (simple) or [here](https://ivis-at-bilkent.github.io/cytoscape.js-node-editing/undoable_demo.html) (undoable) for demos

## Default Options

Expand Down Expand Up @@ -91,7 +91,17 @@ Click [here](https://raw.githack.com/iVis-at-Bilkent/cytoscape.js-node-editing/u
s: "s-resize",
sw: "sw-resize",
w: "w-resize"
}
},
grappleLocations: [ // the locations to show the grapples. Remove "topcenter" for example to avoid overlap with cytoscape.js-node-editing
"topleft",
"topcenter",
"topright",
"centerright",
"bottomright",
"bottomcenter",
"bottomleft",
"centerleft",
],

// enable resize content cue according to the node
resizeToContentCueEnabled: function (node) {
Expand Down Expand Up @@ -186,7 +196,7 @@ This project is set up to automatically be published to npm and bower. To publi
1. Bump the version number and tag: `npm version major|minor|patch`
1. Push to origin: `git push && git push --tags`
1. Publish to npm: `npm publish .`
1. If publishing to bower for the first time, you'll need to run `bower register cytoscape-edge-editing https://github.com/iVis-at-Bilkent/cytoscape.js-edge-editing.git`
1. If publishing to bower for the first time, you'll need to run `bower register cytoscape-node-editing https://github.com/iVis-at-Bilkent/cytoscape.js-node-editing.git`

## Team

Expand Down
2 changes: 1 addition & 1 deletion cytoscape-node-editing.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cytoscape-node-editing",
"version": "3.2.0",
"version": "4.1.0",
"description": "",
"main": "cytoscape-node-editing.js",
"spm": {
Expand Down
18 changes: 13 additions & 5 deletions src/cytoscape-node-editing.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,16 @@
sw: "sw-resize",
w: "w-resize"
},

grappleLocations: [
"topleft",
"topcenter",
"topright",
"centerright",
"bottomright",
"bottomcenter",
"bottomleft",
"centerleft",
],
resizeToContentCueEnabled: function (node) {
return true;
},
Expand Down Expand Up @@ -480,11 +489,10 @@
var ResizeControls = function (node) {
this.parent = node;
this.boundingRectangle = new BoundingRectangle(node);
var grappleLocations = ["topleft", "topcenter", "topright", "centerright", "bottomright",
"bottomcenter", "bottomleft", "centerleft"];

this.grapples = [];
for(var i=0; i < grappleLocations.length; i++) {
var location = grappleLocations[i];
for(var i=0; i < options.grappleLocations.length; i++) {
var location = options.grappleLocations[i];
var isActive = true;
if (options.isNoResizeMode(node) || (options.isFixedAspectRatioResizeMode(node) && location.indexOf("center") >= 0)) {
isActive = false;
Expand Down