cytoscape / ipycytoscape

A Cytoscape Jupyter widget
https://ipycytoscape.readthedocs.io/en/master/
BSD 3-Clause "New" or "Revised" License
261 stars 62 forks source link

Cytoscape not Rendering in Jupyter Notebook 6.5.6 #350

Open MikeB2019x opened 7 months ago

MikeB2019x commented 7 months ago

I am trying out cytoscape in jupyter notebook v6.5.6. The code is as follows:

import networkx as nx
import ipycytoscape
import ipywidgets as widgets

cytoscapeobj = ipycytoscape.CytoscapeWidget()
G = nx.complete_graph(5)
cyto = cytoscapeobj
cyto.graph.add_graph_from_networkx(G)
cyto

Extensions installed are: enter image description here

The code throws a javascript error in the cell that is as follows:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'CytoscapeModel' from module 'jupyter-cytoscape'
TypeError: e is not a function
    at i (http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:9028)
    at Object. (http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:9081)
    at n (http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:2117)
    at http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:2491
    at r (http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:2500)
    at 4226 (http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:9651)
    at r (http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:1025373)
    at http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:1029580
    at http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:1053454
    at http://localhost:9989/nbextensions/jupyter-cytoscape/index.js?v=20231119150121:2:1053460

Based on suggestions I've successfully run !jupyter nbextension enable --py widgetsnbextension which returns Validating OK. The IPy and Jupyter related packages that are installed are:

ipycytoscape                      1.3.3
ipykernel                         6.26.0
ipympl                            0.9.3
ipython                           8.17.2
ipython-genutils                  0.2.0
ipywidgets                        8.1.1
jupyter_client                    7.4.9
jupyter-contrib-core              0.4.2
jupyter-contrib-nbextensions      0.7.0
jupyter_core                      5.5.0
jupyter-events                    0.8.0
jupyter-highlight-selected-word   0.2.0
jupyter-nbextensions-configurator 0.6.3
jupyter_server                    2.9.1
jupyter_server_terminals          0.4.4
jupyterlab-pygments               0.2.2
jupyterlab-widgets                3.0.9

Not sure what to do to get the graph to render?