cytoscape.js

cytoscape.js How to remove the grey circle when panning

陌路散爱 提交于 2019-12-10 21:39:20
问题 i use cytoscape.js. to draw Node Graphs if i pan the Graph with Mouse, there is a grey circle on my mouse position. I have no Idea how to remove this. Can you help me please? Thank you :) 回答1: Only Overwrite the Core style for remove grey circle: .selector('core') // just core properties .css({ 'active-bg-size': 0 }) 回答2: What you are describing is the active state on the background, indicated by the semitransparent circle around the cursor (or your finger on touch). For reasons of

CytoscapeJS - show node neighborhood?

[亡魂溺海] 提交于 2019-12-10 20:59:11
问题 I have a dataset in JSON format containing information about nodes and edges which I am using to generate a network graph in cytoscapeJS. The JSON data contains id, value, shape, colour and visibleDisplay ('element' or 'none') attributes for nodes and id, source, target and label for edges . My stylesheet uses this 'visibleDisplay' property to show/ hide nodes, as needed, when the cy container is first initialised. I want to allow users to unhide nodes with an option to "Show neighbourhood" .

Cytoscape.js - selector for edges attached to selected node

社会主义新天地 提交于 2019-12-10 13:46:29
问题 I want to set the color of all edges that are attached to a selected node, so that each time a user selects a node any edges that the node is either a source or target of will be a different color. What would the selector look like for this, or is it not possible? 回答1: You can't just use a selector, because you need a small graph traversal in addition to the initial filter, e.g.: cy.$('node:selected').neighborhood('edge') ; i.e. for selected nodes get all connected edges Or cy.$('node

Adding cytoscape node at the location of mouse cursor

≯℡__Kan透↙ 提交于 2019-12-10 11:27:56
问题 I want to add a cytoscape node at the location of mouse arrow, on a click event on the canvas. How can I do this? My approach : (not working so well) I am able to create a node on a click but I am not able to make sure the position of the created node is at the place where I have clicked. Using something like this: $("#cy").click(function(event){ pos = getMousePosition(this, event) cy.add([ { group: "nodes", data: { id: "testid" }, position: pos }, ]); }); I have not been able to define

How to use a descreteMapper like on cytoscapeweb?

你说的曾经没有我的故事 提交于 2019-12-08 13:29:22
问题 My nodes contain an attribute "classid". For every classid I would like to use a specific background-image. How can I map data to a node-attribute, like it was possible on cytoscapeweb by using the descretemapper (http://cytoscapeweb.cytoscape.org/documentation/mappers#section/DiscreteMapper)? Here my code from cytoscapeweb: var iconMapper = { defaultValue: "icons/BMC_BASEELEMENT.png", discreteMapper: { attrName: "classid", entries: [ { attrValue: "BMC_CHASSIS", value: "icons/BMC_CHASSIS.png"

cytoscape.js multiple instances on page

不羁岁月 提交于 2019-12-08 08:19:44
问题 I am having trouble having two instances of cytoscape setup on same webpage. I have two window vars "cy" and "cy2" that are being used for different graphs. They are functionally different graphs and need to be available on different parts of the page. I wanted to know how to get that setup correctly? When I look at page elements, the one not showing has the width and height of the underlying canvases set to 0 by cytoscape.js. Can you please help me to understand what is being initialized

How to use tooltip javascript library(qtip.js) together with cytoscape.js

a 夏天 提交于 2019-12-08 07:02:46
问题 I want to use qtip together with cytoscape.js to dispaly tooltips in nodes on mouseover event in graph created with cytoscape.js. I have placed following code inside ready: function() as shown below: cy.on('mouseover','node',function (event) { var eid = $(this).data('id'); $(this).qtip({ overwrite: false, content: eid, position: { my: 'right center', at: 'left center', target: $(this) }, show: { event: event.type, ready: true }, hide: { fixed: true } }, event); }); But, there is no tooltip

cytoscape.js and Angular6

梦想与她 提交于 2019-12-08 05:27:14
问题 I want to import cytoscape.js library in my angular project, but I don't know how to do it. As far as I know, there is no official cytoscape module for angular, is there any way to import cytoscape manually? 回答1: UPDATE: Please see the answer of D.C. Joo, this should be the accepted answer. Actually, it's no problem to import JS libraries in Angular, thats how I do it using npm and Angular6: Run npm install cytoscape Download Cytoscape from https://github.com/cytoscape/cytoscape.js/blob

Increase width of selected edges only (cytoscape.js)

 ̄綄美尐妖づ 提交于 2019-12-07 19:44:13
问题 How can I predefine when I select a few nodes that are connected or simply edges, to make the width of the selected edges be bigger, without affecting the rest of edges of the entire network or the node's width? I predefined this when the nodes or edges are selected: $('#cy').cytoscape({ style: cytoscape.stylesheet() .selector(':selected') .css({ 'background-color': 'black', 'line-color': 'red', 'target-arrow-color': 'black', 'source-arrow-color': 'black', 'opacity': 1 })... but there is no

cytoscape.js and Angular6

余生长醉 提交于 2019-12-07 18:59:31
I want to import cytoscape.js library in my angular project, but I don't know how to do it. As far as I know, there is no official cytoscape module for angular, is there any way to import cytoscape manually? UPDATE: Please see the answer of D.C. Joo, this should be the accepted answer. Actually, it's no problem to import JS libraries in Angular, thats how I do it using npm and Angular6: Run npm install cytoscape Download Cytoscape from https://github.com/cytoscape/cytoscape.js/blob/master/dist/cytoscape.min.js Create a directory scripts in your Angular root directory and place the downloaded