Git Product home page Git Product logo

Comments (9)

canbax avatar canbax commented on August 25, 2024
  1. put "node_modules/cytoscape-context-menus/cytoscape-context-menus.css" inside the array "styles" inside the file "angular.json".

  2. import the library and other necessary libraries inside a ts file like

import cytoscape from 'cytoscape';
import * as contextMenus from 'cytoscape-context-menus';
import * as $ from 'jquery';

And then register the extension like cytoscape.use(contextMenus, $);. Then you can use it as described in the API of the extension.

from cytoscape.js-context-menus.

ErnestManukyan avatar ErnestManukyan commented on August 25, 2024

cytoscape.use() method has only one input parameter

from cytoscape.js-context-menus.

ErnestManukyan avatar ErnestManukyan commented on August 25, 2024
/**
 * Register imported extension into cytoscape
 * @param module Entry point for the extension, got by module = require('cy-ext')
 * or by import module from 'cy-ext'
 * http://js.cytoscape.org/#extensions
 */
function use(module: Ext): void;

from cytoscape.js-context-menus.

canbax avatar canbax commented on August 25, 2024

my dependencies are. It works fine for me.

    "cytoscape": "^3.14.2",
    "cytoscape-context-menus": "^3.1.0",
    "jquery": "^3.5.1",

did you try running? If you try what is the error message you get?

edit you should rerun ng serve when you changed "angular.json" file

from cytoscape.js-context-menus.

ErnestManukyan avatar ErnestManukyan commented on August 25, 2024

It's still not working.
First of all, I have a problem when trying to register the extension.

image

from cytoscape.js-context-menus.

ErnestManukyan avatar ErnestManukyan commented on August 25, 2024

I did update and the packages versions are the same as You have.

from cytoscape.js-context-menus.

ErnestManukyan avatar ErnestManukyan commented on August 25, 2024

Can you please share your use method's signature ?

from cytoscape.js-context-menus.

canbax avatar canbax commented on August 25, 2024

I think you are importing types for cytoscape. I recommend you to not do that.

cytoscape.js and probably all of its extensions do not support typescript natively. There might be some wrappers around them to use typescript.

You should import cytoscape and extensions as JAVASCRIPT modules. So there won't be any type information. With js the editor won't show you such errors. You won't see the signatures of methods.

from cytoscape.js-context-menus.

ErnestManukyan avatar ErnestManukyan commented on August 25, 2024

@canbax helped me to change my code.
So, the problem was about importing types like typescript. We imported cytoscape and extensions as JAVASCRIPT modules and now everything works fine.
Dear @canbax thank you very much !!!

from cytoscape.js-context-menus.

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.