Comments (6)
Are you able to reproduce your issue in a more minimal way without React, say in a slightly modified version of the demo in the repo?
from cytoscape.js-automove.
This issue has been automatically marked as stale, because it has not had activity within the past 30 days. It will be closed if no further activity occurs within the next 30 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.
from cytoscape.js-automove.
@maxkfranz looks like the function to get rule listener is hard coded for
'mean' => put the node in the average position of its neighbourhood
'viewport' => keeps the node body within the viewport
'drag' => matching nodes are effectively dragged along
and defaults to rule.when if those are not given.
while the github readme states that you can pass a function
// specify how a node's position should be updated with one of
// - function( node ){ return { x: 1, y: 2 }; } => put the node where the function returns
// - { x1, y1, x2, y2 } => constrain the node position within the bounding box (in model co-ordinates)
// - { x1, y1, x2, y2, type: 'inside' } => constrain the node position within the bounding box (in model co-ordinates)
// - { x1, y1, x2, y2, type: 'outside' } => constrain the node position outside the bounding box (in model co-ordinates)
However rule.when is undefined by default, so rule.listen is undefined
from cytoscape.js-automove.
@manotoor, do you have a test case that reproduces the error you mentioned?
from cytoscape.js-automove.
I have a similar issue as well
this.cy.automove({
nodesMatching: this.cy.nodes(),
reposition: node => {
const pos = node.position();
return { y: pos.y };
},
when: undefined
});
shows the following error:
index.mjs:9411 Uncaught TypeError: rule.listener is not a function
at addRule (index.mjs:9411)
at Core.automove (index.mjs:9502)
at SMPLE._configureAutoMove (index.mjs:9697)
at index.mjs:9688
from cytoscape.js-automove.
Hi,
Has there been any update on this ?
I get the same error when given a function for resposition
from cytoscape.js-automove.
Related Issues (20)
- Fire `automove` event when a rule sets a node position
- `reposition: 'mean'` should not affect degree zero nodes
- `reposition: 'mean'` should not apply if the open neighbourhood has less than 2 nodes
- `reposition: 'mean'` should account for neighbourhood changes (add/remove eles)
- Improve performance by caching total nodes list and allowing a rule to use a collection
- `meanIgnores` : Option to exclude certain elements from calculation used in `reposition: 'mean'`
- `reposition: 'drag'` : Option to drag certain elements along with others
- Preset for dragging all nodes in a component together HOT 1
- How to undo rules HOT 1
- Destroy all rules fails with exception
- Uncaught RangeError: Maximum call stack size exceeded - when creating rules HOT 1
- ES import not working and 'this' not defined HOT 3
- Cannot drag successors of arbitrary node HOT 2
- Page not found HOT 2
- Rule object should be returned directly
- Move 2 nodes in same y coordinate and keep same distance in x HOT 3
- demo.html doesn't work, or I don't understand it HOT 3
- automove an arbitrary collection of elements HOT 3
- `rule.apply()` to run a rule check cycle manually
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-automove.