Biojs.ChEMBLCompound showcase
PLEASE NOTE: the above example is being affected by the CSS rules of this site. Click on 'view in window' to see the component by using its own CSS stylesheet(s) only.
View in windowOverview
Version
1.0.0.
To get the above Biojs.ChEMBLCompound to work on your page, you need to do the following:
- Include the file Biojs.ChEMBLCompound.js and its dependencies to your page header.
Biojs scripts
<script language="JavaScript" type="text/javascript" src="src/Biojs.js">
- Create a div tag which holds an unique identifier.
<body> ... <div id="YourOwnDivId" /> ... </body> - Create a code snippet within a <script> tag and instance Biojs.ChEMBLCompound into.
window.onload = function() { var instance = new Biojs.ChEMBLCompound({ target: 'YourOwnDivId', id: 'CHEMBL67' }); };
Required Parameters
-
id | {string}
ChEBI identifier of the compound to be displayed (i.e. '4991').
Optional Parameters
-
imageUrl | {string}
Url of the web service in order to require the compound image. To get a compound image, 'imageUrl + id' will be used as URI.
Default: "http://www.ebi.ac.uk/chebi/displayImage.do" -
height | {int}
The height in pixels of how big this image should be displayed.
Default: 400 -
width | {int}
The width in pixels of how big this image should be displayed.
Default: 400
setId
Parameters:
-
chEMBLId
Example :
instance.setId('4991');
onLoadedImage
Parameters:
-
{function} actionPerformed
An function which receives an Biojs.Event object as argument.
Returned data in the Biojs.Event object:
-
{Object}
source
The component which did triggered the event. -
{string}
id
The identifier of the loaded file.
Example :
instance.onLoadedImage(
function( e ) {
alert( e.id + " loaded." );
}
);
onRequestError
Parameters:
-
{function} actionPerformed
An function which receives an Biojs.Event object as argument.
Returned data in the Biojs.Event object:
-
{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'.
Example :
instance.onRequestError(
function( e ) {
alert( e.message );
}
);

