Class Index | File Index

Classes


Class Biojs.ChEBICompound


Version 1.0.0.

Extends Biojs.

Defined in: Biojs.ChEBICompound.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
constructor(options)
 
 
setId(chebiId)
Set the identifier of the chemical component.
Methods borrowed from class Biojs:
addListener, extend, getId, listen, raiseEvent, removeListener, setEventHandlers, setOptions
Event Summary
Event Attributes Event Name and Description
 
onImageLoaded(actionPerformed)
 
onRequestError(actionPerformed)
Class Detail
Biojs.ChEBICompound(options)
var instance = new Biojs.ChEBICompound({
   target: 'YourOwnDivId',
   id: 'CHEBI:2922',
   width: 700,
   height: 400
});
Parameters:
{Object} options
An object with the options for the component.
Options detailed:
{string} [imageUrl="http://www.ebi.ac.uk/chebi/displayImage.do"]
Url of the web service in order to require the compound image. To get a compound image, 'imageUrl + id' will be used as URI.
{string} id
ChEBI identifier of the compound to be displayed (i.e. '4991').
{int} [height=undefined]
The height in pixels of how big this component should be displayed. If it's not specified, the CSS value will be used instead.
{int} [width=undefined]
The width in pixels of how big this image should be displayed. If it's not specified, the CSS value will be used instead.
Requires:
Server side proxy
ChEBICompound.css
jQuery Core 1.6.4
Method Detail
constructor(options)
Parameters:
options

getHTML()

setId(chebiId)
Set the identifier of the chemical component. Shows both information and image for the new identifier.
instance.setId('CHEBI:4991');
// No image available 
instance.setId('CHEBI:60004');
Parameters:
{string} chebiId
Chemical EBI's identifier for the compound to be displayed.
Event Detail
onImageLoaded(actionPerformed)
instance.onImageLoaded(
   function( e ) {
      alert( e.id + " loaded." );
   }
);
Parameters:
{function} actionPerformed
An function which receives an Biojs.Event object as argument.
Event object data:
{Object} source
The component which did triggered the event.
{string} id
The identifier of the loaded file.

onRequestError(actionPerformed)
instance.onRequestError(
   function( e ) {
      alert( e.message );
   }
);
Parameters:
{function} actionPerformed
An function which receives an Biojs.Event object as argument.
Event object data:
{Object} source
The component which did triggered the event.
{string} file
The name of the loaded file.
{string} result
A string with either value 'success' or 'failure'.
{string} message
Error message in case of result be 'failure'.

Documentation generated by JsDoc Toolkit 2.3.2 on Thu Apr 17 2014 17:42:41 GMT+0100 (BST)