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

Why there is no property "panzoom" in my cy? version 3.21.1 #37

Closed
DiligentTuolaji opened this issue Apr 13, 2022 · 2 comments
Closed

Comments

@DiligentTuolaji
Copy link

No description provided.

@pmunn-godaddy
Copy link

What was the solution to this? We are seeing the same issue. Why was this resolved @maxkfranz @DiligentTuolaji

@pmunn-godaddy
Copy link

pmunn-godaddy commented Jun 27, 2024

Here are my cytoscape package versions in my package.json:

    "cytoscape": "^3.29.2",
    "cytoscape-expand-collapse": "^4.1.0",
    "cytoscape-panzoom": "^2.5.3",
    "cytoscape-undo-redo": "^1.3.3",
    "react-cytoscapejs": "^1.2.1"

and here is how the panzoom library is initialized and then called:

import Cytoscape from 'cytoscape';
import panzoom from 'cytoscape-panzoom';
import 'cytoscape-panzoom/cytoscape.js-panzoom.css';
import merge from 'lodash.merge';
import CytoscapeComponent from 'react-cytoscapejs';

panzoom(Cytoscape);

...
...
...

return 

(<CytoscapeComponent
        elements={ CytoscapeComponent.normalizeElements(graphData) }
        style={{ height: graphHeight }}
        zoomingEnabled={ true }
        maxZoom={ 3 }
        minZoom={ 0.001 }
        autounselectify={ false }
        boxSelectionEnabled={ true }
        layout={ merge([], defaultLayout, graphLayout) }
        stylesheet={ merge([], defaultStyles, graphStyles) }
        cy={ (cy) => {
          cy.panzoom(defaultPanZoom);
        } }
      />
    </div>
  );

This used to work but recently I've been getting the error e.panzoom is not a function. I suspect it has to do with the way the dependencies are initialized but I'm not sure

All of the cytoscape extensions look good in node_modules in the prod docker image:

/app/node_modules # ls -a | grep 'cyto'
cytoscape
cytoscape-dagre
cytoscape-expand-collapse
cytoscape-panzoom
cytoscape-undo-redo
react-cytoscapejs

Here is the cytoscape panzoom folder in the prod docker image:

/app/node_modules # ls cytoscape-panzoom
LICENSE                   bower.json                cytoscape.js-panzoom.css  font-awesome-4.0.3        img
README.md                 cytoscape-panzoom.js      demo.html                 gulpfile.js               package.json 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants