Class Index | File Index

Classes


Class Biojs.Cytoscape


Version 1.0.1_beta.

Extends Biojs.

Defined in: Biojs.Cytoscape.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Cytoscape Wrapper A Wrapper for cytoscape.js (cytoscape web 2) For more information go to http://cytoscape.github.com/cytoscape.js/
Field Summary
Field Attributes Field Name and Description
<inner>  
Array containing the supported event names
<inner>  
opt
Default values for the options
Method Summary
Method Attributes Method Name and Description
 
add(options)
Add elements to the graph.
 
backgroundBind(options)
Bind to an event that happens specifically on the background of the graph.
 
backgroundOne(options)
Add a callback function to be called one time when an event first occurs on the background of the graph.
 
Trigger an event that happens specifically on the background of the graph.
 
Remove a previous binding to an event that happens specifically on the background of the graph.
 
bind(options)
Bind to an event that happens anywhere in the graph.
 
center(collection)
Centre the graph on an element or a collection.
 
Get an empty collection.
 
constructor(options)
 
edges(options)
Get particular edges with a selector.
 
elements(options)
Get particular elements (nodes and edges) with a selector.
 
filter(options)
Get particular elements (nodes and edges) with a selector or a filter function.
 
fit(collection)
Fit the graph to an element or a collection.
 
load(options)
Load a graph into Cytoscape Web.
 
nodes(options)
Get particular nodes with a selector.
 
one(options)
Add a callback function to be called one time when an event first occurs anywhere on the graph.
 
pan(renderedPosition)
Pan the graph to an absolute position.
 
panby(renderedPosition)
Pan the graph relatively from its current position.
 
remove(options)
Remove elements from the graph.
 
Reset the graph to the default zoom level and the default position for panning.
 
trigger(options)
Trigger an event on the graph.
 
unbind(options)
Remove a previous binding to an event that happens anywhere in the graph.
 
zoom(options)
Adjust the zoom level of the graph.
Methods borrowed from class Biojs:
addListener, extend, getId, listen, raiseEvent, setEventHandlers, setOptions
Event Summary
Event Attributes Event Name and Description
 
onCytoscapeReady(actionPerformed)
Class Detail
Biojs.Cytoscape()
Cytoscape Wrapper A Wrapper for cytoscape.js (cytoscape web 2) For more information go to http://cytoscape.github.com/cytoscape.js/
Author: José M. Villaveces.
var instance = new Biojs.Cytoscape({
     target: "YourOwnDivId"
});
Requires:
jQuery Core 1.7.2
Cytoscape web 2
Arbor JS
Arbor Layout
Field Detail
<inner> eventTypes
Array containing the supported event names

<inner> opt
Default values for the options
Method Detail
add(options)
Add elements to the graph.
instance.add([ { group: "nodes", data: { id: "n0" }},{ group: "nodes", data: { id: "n1" }},{ group: "edges", data: { id: "e0", source: "n0", target: "n1" }}]);
Parameters:
{Object} options

backgroundBind(options)
Bind to an event that happens specifically on the background of the graph.
instance.backgroundBind("click", function(){alert("clicked on cytoweb")});
Parameters:
{Object} options

backgroundOne(options)
Add a callback function to be called one time when an event first occurs on the background of the graph.
instance.backgroundOne("click", function(){alert("clicked on cytoweb")});
Parameters:
{Object} options

backgroundTrigger(options)
Trigger an event that happens specifically on the background of the graph.
instance.backgroundTrigger("click");
Parameters:
{Object} options

backgroundUnbind(options)
Remove a previous binding to an event that happens specifically on the background of the graph.
instance.backgroundUnbind("click", function(){alert("clicked on cytoweb")});
Parameters:
{Object} options

bind(options)
Bind to an event that happens anywhere in the graph.
instance.bind("click", function(){alert("clicked on cytoweb")});
Parameters:
{Object} options

center(collection)
Centre the graph on an element or a collection.
instance.center(instance.node("a"));
Parameters:
{Object} collection

collection()
Get an empty collection.
var collection = instance.collection();

constructor(options)
Parameters:
options

edges(options)
Get particular edges with a selector.
var collection = instance.edges("[source=n0]");
Parameters:
{Object} options

elements(options)
Get particular elements (nodes and edges) with a selector.
var collection = instance.elements("[weight>50]");
Parameters:
{Object} options

filter(options)
Get particular elements (nodes and edges) with a selector or a filter function.
var collection = instance.filter("[weight>50]");
Parameters:
{Object} options

fit(collection)
Fit the graph to an element or a collection.
instance.fit(instance.node("a"));
Parameters:
{Object} collection

load(options)
Load a graph into Cytoscape Web.
instance.load([{ data: { id: "n1" }, group: "nodes" },{ data: { id: "n2" }, group: "nodes" },{ data: { id: "e1", source: "n1", target: "n2" }, group: "edges" }]);
Parameters:
{Object} options

nodes(options)
Get particular nodes with a selector.
var collection = instance.nodes("[weight>50]");
Parameters:
{Object} options

one(options)
Add a callback function to be called one time when an event first occurs anywhere on the graph.
instance.one("click", function(){alert("clicked on cytoweb")});
Parameters:
{Object} options

pan(renderedPosition)
Pan the graph to an absolute position.
instance.pan({x: 100, y: 100});
Parameters:
{Object} renderedPosition

panby(renderedPosition)
Pan the graph relatively from its current position.
instance.panBy({x: 100, y: 100});
Parameters:
{Object} renderedPosition

remove(options)
Remove elements from the graph.
instance.remove(instance.nodes("#n0"));
Parameters:
{Object} options

reset()
Reset the graph to the default zoom level and the default position for panning.
instance.reset();

trigger(options)
Trigger an event on the graph.
instance.trigger("click");
Parameters:
{Object} options

unbind(options)
Remove a previous binding to an event that happens anywhere in the graph.
instance.unbind("click", function(){alert("clicked on cytoweb")});
Parameters:
{Object} options

zoom(options)
Adjust the zoom level of the graph.
instance.zoom({level: 2.0, renderedPosition: { x: 100, y: 100}});
Parameters:
{Object} options
Event Detail
onCytoscapeReady(actionPerformed)
instance.onCytoscapeReady(
   function( cy ) {
      cy.center();
   }
);
Parameters:
{function} actionPerformed
A function which receives a Biojs.Event object as argument.
Event object data:
{Object} cytoscape
The current cytoscape instance.

Documentation generated by JsDoc Toolkit 2.3.2 on Fri Aug 23 2013 13:38:37 GMT+0100 (BST)