Git Product home page Git Product logo

Comments (6)

maxkfranz avatar maxkfranz commented on June 11, 2024

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.

stale avatar stale commented on June 11, 2024

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.

manotoor avatar manotoor commented on June 11, 2024

@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.

maxkfranz avatar maxkfranz commented on June 11, 2024

@manotoor, do you have a test case that reproduces the error you mentioned?

from cytoscape.js-automove.

srinivasrk avatar srinivasrk commented on June 11, 2024

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.

SheereenHamza avatar SheereenHamza commented on June 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.