Git Product home page Git Product logo

Comments (14)

EniesLobby avatar EniesLobby commented on June 12, 2024

Same issue

from cytoscape.js-cxtmenu.

maxkfranz avatar maxkfranz commented on June 12, 2024

Is there a cytoscape.use(ext) after import?

from cytoscape.js-cxtmenu.

EniesLobby avatar EniesLobby commented on June 12, 2024

Hi maxkfranz,

yes, the code's structure is similar to the author's one with cytoscape.use(ext) in it.

in component side:

import * as cytoscape from 'cytoscape';
import * as cxtmenu from 'cytoscape-cxtmenu';
cytoscape.use(cxtmenu);

in typings.d.ts:

declare module 'cytoscape-cxtmenu';

in angular.json scripts are also included.

It does not see cy.ctxmenu();

Thank you for your help!

from cytoscape.js-cxtmenu.

maxkfranz avatar maxkfranz commented on June 12, 2024

If the TS import is the same as the ES import, then you need to use the default export rather than *.

from cytoscape.js-cxtmenu.

maxkfranz avatar maxkfranz commented on June 12, 2024
import cytoscape from 'cytoscape';
import cxtmenu from 'cytoscape-cxtmenu';

cytoscape.use( cxtmenu );

from cytoscape.js-cxtmenu.

kanakl avatar kanakl commented on June 12, 2024

I have same issue. I have error message in visual sutido code "Property 'cxtmenu' does not exist on type 'Core'". Is it possible use it in typescript? I try add to index.d.ts this:
declare module 'cytoscape-cxtmenu' {
const ext: cytoscape.Ext;
export = ext;
}
But still not working.

from cytoscape.js-cxtmenu.

EHadoux avatar EHadoux commented on June 12, 2024

Isn't it because it's cxtmenu and not ctxmenu?

from cytoscape.js-cxtmenu.

canbax avatar canbax commented on June 12, 2024

I managed to use cytoscape.js-context-menus extension (https://github.com/iVis-at-Bilkent/cytoscape.js-context-menus) on angular 7 project.

I added "node_modules/cytoscape-context-menus/cytoscape-context-menus.css" to styles of the project inside angular.json file and use it as mentioned in the readme of the extension

from cytoscape.js-cxtmenu.

stale avatar stale commented on June 12, 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-cxtmenu.

wasiftdh avatar wasiftdh commented on June 12, 2024

I managed to use cytoscape.js-context-menus extension (https://github.com/iVis-at-Bilkent/cytoscape.js-context-menus) on angular 7 project.

I added "node_modules/cytoscape-context-menus/cytoscape-context-menus.css" to styles of the project inside angular.json file and use it as mentioned in the readme of the extension

I did the same but its still giving me error this.cy.contextMenu() is not a function in angular 7.

from cytoscape.js-cxtmenu.

ErnestManukyan avatar ErnestManukyan commented on June 12, 2024

I have same issue, when trying to integrate ctxmenu in my angular project.
So, the issue is closed, but I could not understand the solution.
Please help me !

from cytoscape.js-cxtmenu.

dmitrioligy avatar dmitrioligy commented on June 12, 2024

import cxtmenu from 'cytoscape-cxtmenu';
cytoscape.use(cxtmenu);
...
let cy = cytoscape({ opt });
cy.cxtmenu({ cxtOpt });

Can not register cxtmenu for core since cxtmenu already exists in the prototype and can not be overridden

Alternative

let cy = cytoscape({ opt });
cy.cxtmenu({
selector: 'node, edge',
...

Uncaught (in promise) TypeError: cy.cxtmenu is not a function

I haven't had any luck.

I am using Svelte & Sapper. I have the graph working fine without cxtmenu, adding it in, it breaks. Any feedback would help!

from cytoscape.js-cxtmenu.

Jobvdb avatar Jobvdb commented on June 12, 2024

So, was anyone able to come up with a solution?

from cytoscape.js-cxtmenu.

blumTom avatar blumTom commented on June 12, 2024

Had the same issue. Solved it by calling cxtmenu not on the module but on the instance of cytoscape.

from cytoscape.js-cxtmenu.

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.