JSpecView

Wrapper for the spectrum viewer based on JSpecView.

Simple demo application available here.

Summary
JSpecViewWrapper for the spectrum viewer based on JSpecView.
Functions
jspecviewConvert DIV panel into JSpecView viewer.
Types
Options
Functions
addHighlightAdds a highlight to a portion of the plot area of a JSVPanel
removeAllHighlightsRemoves all highlights from the plot area of a JSVPanel
removeHighlightRemoves a highlight from the plot area of a JSVPanel
reversePlotToggles reversing the plot on a JSVPanel
setSpectrumIDShow spectrum loaded from ChemSpider by internal spectrum ID.
setUrlLoads content by Url
toggleCoordinateToggles the coordinate on a JSVPanel
toggleGridToggles grid visibility on a JSVPanel
toggleIntegrationToggles the integration graph of a JSVPanel
writeStatusWrites a message to the status label

Functions

jspecview

Convert DIV panel into JSpecView viewer.

Parameters

optionsInitialization Options
$('#specView').jspecview({
    width: 650,
    height: 350,
    url:'http://www.chemspider.com/FilesHandler.ashx?type=blob&id=188'
});
$('#specView').jspecview({
    width: 650,
    height: 350,
    specId: 2301
});

Types

Options

Properties

widthWidth of the widget in pixels.  Default value - 650
heightHeight of the widget in pixels.  Default value - 350
urlUniform Resource Locator for JCAMP-generating script . Default value - empty string
specIdInternal ChemSpider spectrum Id.  Default value - 0

Functions

addHighlight

addHighlight: function (x1,
x2,
r,
g,
b,
a)

Adds a highlight to a portion of the plot area of a JSVPanel

Parameters

x1the starting x value as datatype double
x2the ending x value as datatype double
rred value of rgb color scheme.  Number from 0-255
gthe green value of rgb color scheme.  Number from 0-255
bthe blue value of rgb color scheme.  Number from 0-255
athe alpha value of rgb color scheme.  Number from 0-255
jsview.addHighlight(5, 75, 0, 0, 255, 0);

removeAllHighlights

removeAllHighlights: function ()

Removes all highlights from the plot area of a JSVPanel

jsview.removeAllHighlights();

removeHighlight

removeHighlight: function (x1,
x2)

Removes a highlight from the plot area of a JSVPanel

Parameters

x1the starting x value as datatype double
x2the ending x value as datatype double
jsview.removeHighlight(50, 100);

reversePlot

reversePlot: function ()

Toggles reversing the plot on a JSVPanel

$('#jspecview').reversePlot();

setSpectrumID

Show spectrum loaded from ChemSpider by internal spectrum ID.

Parameters

idSpectrum ID in ChemSpider DB
jsview.setSpectrumID(6182);

setUrl

setUrl: function (url)

Loads content by Url

Parameters

Url as string

jsview.setUrl('http://chemspider.com/FilesHandler.ashx?type=blob&id=188');

toggleCoordinate

toggleCoordinate: function ()

Toggles the coordinate on a JSVPanel

$('#jspecview').toggleCoordinate();

toggleGrid

toggleGrid: function ()

Toggles grid visibility on a JSVPanel

$('#jspecview').toggleGrid();

toggleIntegration

toggleIntegration: function ()

Toggles the integration graph of a JSVPanel

$('#jspecview').toggleIntegration();

writeStatus

writeStatus: function(msg)

Writes a message to the status label

Parameters

msgthe message to write as string
$('#jspecview').writeStatus('JSpec Viewer');
addHighlight: function (x1,
x2,
r,
g,
b,
a)
Adds a highlight to a portion of the plot area of a JSVPanel
removeAllHighlights: function ()
Removes all highlights from the plot area of a JSVPanel
removeHighlight: function (x1,
x2)
Removes a highlight from the plot area of a JSVPanel
reversePlot: function ()
Toggles reversing the plot on a JSVPanel
setUrl: function (url)
Loads content by Url
toggleCoordinate: function ()
Toggles the coordinate on a JSVPanel
toggleGrid: function ()
Toggles grid visibility on a JSVPanel
toggleIntegration: function ()
Toggles the integration graph of a JSVPanel
writeStatus: function(msg)
Writes a message to the status label