Comments (9)
-
put
"node_modules/cytoscape-context-menus/cytoscape-context-menus.css"
inside the array"styles"
inside the file "angular.json". -
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.
cytoscape.use() method has only one input parameter
from cytoscape.js-context-menus.
/**
* 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.
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.
It's still not working.
First of all, I have a problem when trying to register the extension.
from cytoscape.js-context-menus.
I did update and the packages versions are the same as You have.
from cytoscape.js-context-menus.
Can you please share your use method's signature ?
from cytoscape.js-context-menus.
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.
@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)
- Context menu doesn´t show if browser is in full screen HOT 1
- mouseover event is activated for the entities under the context menu HOT 3
- Trigger context menus only for nodes. HOT 2
- Pop up menu appears outside cytoscape network, even when nothing is clicked HOT 7
- multiple event types HOT 1
- How can I dynamically add items in a submenu? HOT 1
- How can I check if a particular submenu item already exists? HOT 3
- Is it possible to generate a fresh context menu during every right-click event on a node?
- How can I add styling only to a submenu? HOT 6
- Illegal constructor in 4.1 vs 4.0 HOT 3
- Does not work on Next.js SSR/CSR HOT 8
- Menu hide itself when zoom in graph HOT 1
- demos and menu don't work on mobile
- Menus not clickable when using cytoscape-expand-collapse
- Dynamic Context Menus? HOT 6
- Proper way to conditionally trigger on left click (tap)?
- "When I right-click on a node with my mouse, it's all good and shows the menu options I set up. But when I click on a blank area, I get this error popping up saying 'i.is is not a function TypeError: i.is'. Any idea how I can fix this?"
- Context Menu For Multiple Elements
- Submenu indicator is not found HOT 1
- Support Ctrl + Click
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cytoscape.js-context-menus.