Comments (6)
No, this is not possible. In the current implementation, the dragged node positioned in the center of the closest grid (cell).
from cytoscape.js-grid-guide.
is this possible to get worked? whats the technical limitations?
from cytoscape.js-grid-guide.
It could be as simple as not adding 0.5
factor when the snap position is calculated (I think using Math.round
in this case makes more sense):
Test this and see if it has the effect you want (after modifying this line, snap during drag should snap to grid line as well).
This needs to be optional, so that one can switch between the original behavior and the new one. An option named snapToGridCenter
can be defined (the default value should be true
).
You can do a PR if you like.
from cytoscape.js-grid-guide.
Created PR #38 to address this with your implementation suggestion. It worked like a charm!
from cytoscape.js-grid-guide.
@torbgy this feature is now implemented. You can pull it from unstable branch.
from cytoscape.js-grid-guide.
Hows the release coming? I'm still using this featured as a one-off. Any updates on the next release?
from cytoscape.js-grid-guide.
Related Issues (20)
- License Details HOT 1
- "Snap to Grid During Drag" prevents box selection in all nodes HOT 2
- Meet UglifyJs error while building my web code HOT 1
- Grid isn't drawn in latest Firefox HOT 3
- when parent dom element (not body) set ‘background-color’ attrbute then the grid line not display HOT 1
- TypeError $ is not a function HOT 4
- TypeError: cy.gridGuide is not a function HOT 1
- Empty style of grid canvas when drawGrid is false HOT 7
- Automove Support?
- Why was Cytoscape.js dependency updated? HOT 1
- dragfree dragfreeon events don't work when snapToGridDuringDrag is set to true HOT 3
- snapToGridDuringDrag interferes with undo/redo HOT 2
- How to force a grid resize/rerender HOT 3
- Issue with cytoscape-edgehandles , wrong handlePositions HOT 5
- bug with geometric align on drag
- Be compliant with JS strict mode HOT 2
- Support change background HOT 15
- Show only points HOT 6
- Typescript / Angular 14 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cytoscape.js-grid-guide.