Skip to content
maxkfranz edited this page Mar 5, 2012 · 15 revisions

Extensions specification

Introduction

Extensions add functionality to Cytoscape Web by extending the existing API with additional functions (i.e. to the core or collections) or component types (e.g. renderers, layouts, exporters).

It is important to note that plugins are fundamentally different than extensions. Whereas extensions simply extend the existing API on a low level, plugins are high level UI components. Plugins are just regular jQuery plugins that add useful, reusable UI to Cytoscape Web.

This document serves as an overview on how to write a Cytoscape Web extension. For writing jQuery plugins, see the jQuery documentation.

Types of extensions

There are several types of extensions you can write for Cytoscape Web, outlined below by their respective typess.

Naming conventions

A Cytoscape Web extension should be placed in its own file, such as jquery.cytoscapeweb.type.name.js, where type denotes the extension type and name denotes the extension name. For example, a layout named foo would be located in jquery.cytoscapeweb.layout.foo.js.

Defining an extension

Defining an extension is easy, and is best shown by example:

$(function(){ // need to wait for jQuery.ready
  $.cytoscapeweb(type, function(){ // type could be "layout", "renderer", et cetera
    // implementation goes here
  });
});

The return type of the implementation function as well as any other behavioural expectations of the extension are described in the documentation for the specific extension types, linked to at the top of this document in "Types of extensions".

Clone this wiki locally