cytoscape.js

child node positioning within compound nodes in cytoscape.js

*爱你&永不变心* 提交于 2019-12-01 22:42:20
Used cytoscape.js to draw a graph using compound nodes. Need to position the inside node (i.e. child) to specific position of compound node (e.g. left, right, top, bottom, etc.). Is there any way to do this? This feature is planned for 2.4: https://github.com/cytoscape/cytoscape.js/issues/530 来源: https://stackoverflow.com/questions/27780139/child-node-positioning-within-compound-nodes-in-cytoscape-js

Cytoscape. Load dependency from URL

匆匆过客 提交于 2019-12-01 21:20:59
This is a very simple question. How can I indicate the cytoscape as a source via a url? I know with D3 it is very simple <script src="https://d3js.org/d3.v4.min.js"></script> What is the equivalent address for cytoscape? Thanks! The term you're looking for is a CDN-hosted copy of the code; strictly speaking, you're still using a URL even when you specify a local copy. It looks like Cloudflare (a major CDN company) hosts copies of the code; a google search turned up this index which should help you find the correct links for the version you need. 来源: https://stackoverflow.com/questions/40298582

How to reload graph in cytoscape.js?

孤街醉人 提交于 2019-12-01 05:23:46
问题 Is there a function that resets the graph to it's freshly loaded state? I've tried cy.reset() but that just resets zoom and pan, not restoring to the virgin graph. Also is there a way to restore all removed elements? Thanks! 回答1: Call cy.elements().remove() and cy.add() with the same graph data. 来源: https://stackoverflow.com/questions/18391899/how-to-reload-graph-in-cytoscape-js

Add an edge label with Cytoscape.js

帅比萌擦擦* 提交于 2019-11-29 05:36:33
问题 How can I add a label on an edge using Cytoscape.js? 回答1: Map the label style property to a data field: e.g. in the stylesheet on init ... { selector: 'edge', style: { 'label': 'data(label)' // maps to data.label } } ... http://cytoscape.github.com/cytoscape.js/#style/properties Older versions use content: in place of label: . Newer versions of 2.x allow label and also content for backwards compatibility. 来源: https://stackoverflow.com/questions/15172427/add-an-edge-label-with-cytoscape-js

Difficulty in implementing cytoscape.js-qtip

↘锁芯ラ 提交于 2019-11-28 01:30:11
问题 Part I I am finding it difficult to replicate the functionality of cytoscape.js-qtip in my code. Here is the JavaScript Code: $(function() { $('#cy').cytoscape ({ style: cytoscape.stylesheet() .selector('node').css({'content': 'data(name)'}) .selector('edge').css({'target-arrow-shape': 'triangle'}) .selector(':selected').css({'line-color': 'black'}) elements: { nodes: [ { data: { id: '1', name: '1' } }, { data: { id: '2', name: '2' } }, ], edges: [{ data: { source: '1', target: '2' } }] },

How to add tooltip on mouseover event on nodes in graph with cytoscape.js

懵懂的女人 提交于 2019-11-27 07:09:46
问题 I want to show node's details on mouseover event on all nodes in graph created with cytoscape.js. I have found a plug-in qtip, but this is not working. How can i achieve this? Is there some other way to show tooltip on nodes? Thanks in advance. 回答1: You can still use QTip. Because cy.js doesn't have associated DOM elements per graph element, you'll need to either (1) create dummy HTML DOM elements to position the QTips or (2) use the QTip API to manually position the QTips to the nodes. Cy.js