cytoscape.js

How to disabled zoom for one node? Cytoscape.js

空扰寡人 提交于 2019-12-11 18:47:25
问题 Cannot possible disable zoom for node. I searched in docs all words zoom and cannot found this opportunities. I want set on some nodes property like disabledZoom or maybe it will be setting zoom for some nodes. 回答1: I search answer and found only one decision. Cytoscape cannot disable one node for zoom. I created example with manual control zooming on the element. example: https://codesandbox.io/s/loving-sky-m5mze 来源: https://stackoverflow.com/questions/58337883/how-to-disabled-zoom-for-one

Cytoscape layouts - Handle locked nodes

女生的网名这么多〃 提交于 2019-12-11 14:57:36
问题 I am using vue-cytoscape to render a graph and navigate through a tree-like data structure. My goal is to expand parent nodes and keep their position in the graph. I would like to simply add the new children nodes. My approach is to lock current nodes, add the children and unlock the nodes. this.cy.nodes().lock() for(let d of data){ this.cy.add(d) } this.cy.elements().layout(this.config.layout).run() setTimeout(() => {this.cy.nodes().unlock()}, 2000) // Give some time for the layout to render

cy.load() elements are lost

独自空忆成欢 提交于 2019-12-11 13:08:40
问题 I'm trying to store the current graph in browser on the server side and now I'm testing how to. I ran into a strange Problem: after jsoning, decycling, stringifying and reloading the graph, the elements are somehow lost. var j = network_tab.cy.json(); j = JSON.decycle(j); j = JSON.stringify(j); network_tab.cy.load(j); Before decycling the graph, I cannot stringify it. If you look in the stringified version, you can see, that the elements are still there, but after loading, they are gone.

cytoscape.js elements disappear when using Firefox to zoom in or out

瘦欲@ 提交于 2019-12-11 10:56:19
问题 Using Firefox 24.0 on Ubuntu 12.04, I can reproduce this by: Going to http://cytoscape.github.io/cytoscape.js/ with Firefox Use Ctrl + + or Ctrl + - to zoom in or out Move the mouse over the graph in the corner and watch it disappear. Seems to work fine in Chrome. Any ideas on how to fix this? 回答1: The same version of Firefox on Mac does not have this issue, leading me to believe this is a Firefox problem or an Ubuntu problem. If I were you, I would file a bug report with Mozilla: https:/

Grab compound nodes when a child node is grabbed

▼魔方 西西 提交于 2019-12-11 10:13:12
问题 I'm currently trying to implement the developp the following behavior in my application embedding Cytoscape.js : I would like that when a particular child node of a compound node is grabbed, the whole compound node is grabbed. If tried using this code but it does not work as I expect : cy.$(mySubNodeSelector) .on('grab', function(){ this.ungrabify(); this.parent().select(); this.parent().grabify(); }); Does anybody has an advice about how to implement this behavior ? Thanks a lot. 回答1:

Using Cytoscape rendering inside twitter boostrap tabs

自作多情 提交于 2019-12-11 09:44:52
问题 I am using two cytoscape graphs inside twitter bootstrap 3 tabs (one graph per tab). My trouble is that only active tab is renderer, when I select hidden tab it's graph is not rendered (the graph is rendered if I open / close firebug (with F12) on firefox). I tried to solve this by : $('#view-target').cytoscape({ ... ready: function(){ window.cytoscapeTarget = this; } }); $('#show-target').on('shown.bs.tab', function (e) { window.cytoscapeTarget.forceRender(); }); Without success. The graph

Adding Html Buttons/Html Elements inside a Cytoscape node

我与影子孤独终老i 提交于 2019-12-11 09:44:42
问题 How Can I add an Html elements inside a Cytoscape node? E.g: I want to add to every node - 2 small buttons, so the user can click on each one of the buttons and the value inside this node will change. Example of the graph I want to create [IMG]http://i57.tinypic.com/1z1bp1l.jpg[/IMG] 回答1: It's not possible to render HTML in a canvas, nor would you probably want to for performance. If you really want it on the node, I suggest creating an overlay -- though that has its own set of complications

add nodes and edges through loop in cytoscape arbor layout

China☆狼群 提交于 2019-12-11 02:28:34
问题 I want to add more than 10 nodes in arbor.js layout.This code adds nodes and edges in arbor layout for cytoscape elements: { nodes: [ { data : { id: b[0], faveBorderColor: "#AAAAAA", name: b[0], faveColor: "#EEB211", faveFontColor: "#ffffff" ,'link':'http://www.yahoo.com'} }, { data : { id: a[0], name: a[0], faveColor: "#21526a", faveFontColor: "#fff"} }, { data : { id: a[1], name: a[1], faveColor: "#21526a", faveFontColor: "#fff"} }, { data : { id: a[2], name: a[2], faveColor: "#21526a",

Cytsocape.js can not create edge with nonexistant target

三世轮回 提交于 2019-12-11 02:06:50
问题 I try to create an edge after I created the nodes using an AJAX request. My code: success: function(data) { $.each(data['kids'], function(i, value) { cy.add({ group: 'nodes', data: { id: value['id'] }, position: value['position'] }); }) } This works and created the nodes. Now, using this I try to create the edge: cy.add({ group: 'edges', data: { id: 'e0', source: 'n0', target: 'n1' } }); but returns: Can not create edge e0 with nonexistant source n0 Can not create edge e0 with nonexistant

Show the kind of relation between nodes in cytoscape.js

痞子三分冷 提交于 2019-12-10 22:47:32
问题 I am looking for a software that allows me to draw relations between entities with automatic drawing and with user interaction. I have saw cytoscape.js and it seems like a really good option, but I want to know if with this software you can visualize the name of the relations. The objetive of the example is to draw two persons and show their relation, for example, that they are brothers. Person1 ====== brother =====> Person2 Do I need to modify the code to do this? 回答1: You don't need to