ivis-at-bilkent / cytoscape.js-autopan-on-drag Goto Github PK
View Code? Open in Web Editor NEWA Cytsocape.js extension to automatically pan when nodes are out of canvas bounds
License: MIT License
A Cytsocape.js extension to automatically pan when nodes are out of canvas bounds
License: MIT License
This extension's README lies about dependencies. It does not mention the jQuery dependency. Today for a lot of developers having jQuery as a dependency is quite unattractive resp. unacceptable.
The jQuery dependency should be removed. This extension uses jQuery merely to measure width/height of a DOM element, which might not justify adding such a "deprecated" library to ones project.
The autopan extension seems to be quite useful and just needs some minor "modernization".
Can this extension be ported to Cytoscape ^3.0.0 easily (no breaking-changes)?
The newest release of this extension (2.1.0) throws an error at initialization:
TypeError: undefined is not an object (evaluating 'scratchPad[name]')
Apparently this issue is fixed by #9 but this fix is not yet released.
This extension should be newly released.
I use the edgehandles extension and want trigger auto panning for the edgehandles "ghost node". The ghost node is the one the user moves while drawing an edge. The problem is that the ghost node does not trigger auto panning.
By default the ghost node is transparent and tiny, and I thought this might be the problem:
ghostNode.style({
'background-color': 'blue',
'width': 0.0001,
'height': 0.0001,
'opacity': 0,
'events': 'no'
});
For testing I've made the ghost node bigger and non-transparent, and removed events: no
, but no success.
How can I make edgehandle's ghost node trigger auto panning?
Dragging big nodes (e.g. compounds) that are partially outside viewport bounds results in the node jumping around due to the auto panning. One solution to remedy this might be to disable auto-panning if the node grabbed for drag is partially outside the viewport.
The autopan extension has a scratchpad namespace reference to "_undoRedo" which did not exist. This was likely just a minor copy/paste error from the undo redo extension.
I've submitted a PR #9 with the fix.
Might be a good idea to add this extension and any others you have to Zenodo (https://zenodo.org/). Really easy to set up and it integrates with GitHub so that on every new release it will automatically register the extension with a new DOI.
Can we add an option to control the speed of auto panning?
I have declared several Cytoscape instances on one page with different div as containers. And I called cy.autopanOnDrag({});
for each Cytoscape instance. However, no matter which graph(the node in that graph) I drag, the viewport of the last Cytoscape instance moves.
Here is a part of my code:
cys = $.map($('.cy'), function (container) {
var cy = cytoscape($.extend({}, cytoscapeOptions, {container: container}));
cy.autopanOnDrag({
// options here...
});
return cy;
});
This project is really cool, but I wonder if the package name could be a little bit shorter.
Maybe something like cytoscape-dragpan?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.