SpectrumJS

Wrapper for the spectrum viewer based on HTML5 widget provided by ACD\Labs.

Simple demo application available here.

Summary
SpectrumJSWrapper for the spectrum viewer based on HTML5 widget provided by ACD\Labs.
Functions
spectrumjsConvert DIV panel into SpectrumJS widget.
Types
Options
Functions
resizeResize spectrum widget.
showToolbarShow toolbar’s panel.
hideToolbarHide toolbar’s panel.
toggleToolbarToggle toolbar’s panel.
hasMoleculeCheck either rendeted spectrum has molecule or not.
showMoleculeShow molecule’s panel.
hideMoleculeHide molecule’s panel.
toggleMoleculeToggle molecule’s panel.
toggleAtomNumbersToggle atom numbers.
toggleShiftsToggle shifts.
switchPpmSwitch to Ppm.
switchHzSwitch to Hz.
setFullReset zoom and show full spectrum.
toggleIntegralToggle integral.
setSpectrumIDShow spectrum loaded from ChemSpider by internal spectrum ID.
clearClear all spectra from the widget

Functions

spectrumjs

Convert DIV panel into SpectrumJS widget.

Parameters

optionsInitialization Options
$('#spectrumcontainer').spectrumjs({
    width: 500,
    height: 300
});

Types

Options

Properties

widthWidth of the widget in pixels.  Default value - 800
heightHeight of the widget in pixels.  Default value - 500
moleculeSizesome spectra have assigned data and in this case molecule will be displayed with the size specified by this parameter.  Default value - 250
showMoleculewhether molecule with assigned data should be demonstrated by default or not.  Default value - true
showToolbarspecify whether toolbar should be displayed or not.  Default value - true

Functions

resize

resize: function (width,
height)

Resize spectrum widget.

Parameters

widthnew widget’s width
heightnew widget’s height
spectrum.resize(800, 400);

showToolbar

showToolbar: function ()

Show toolbar’s panel.

spectrum.showToolbar();

hideToolbar

hideToolbar: function ()

Hide toolbar’s panel.

spectrum.hideToolbar();

toggleToolbar

toggleToolbar: function ()

Toggle toolbar’s panel.

spectrum.toggleToolbar();

hasMolecule

hasMolecule: function ()

Check either rendeted spectrum has molecule or not.

spectrum.hasMolecule();

showMolecule

showMolecule: function ()

Show molecule’s panel.

spectrum.showMolecule();

hideMolecule

hideMolecule: function ()

Hide molecule’s panel.

spectrum.hideMolecule();

toggleMolecule

toggleMolecule: function ()

Toggle molecule’s panel.

spectrum.toggleMolecule();

toggleAtomNumbers

toggleAtomNumbers: function ()

Toggle atom numbers.

spectrum.toggleAtomNumbers();

toggleShifts

toggleShifts: function ()

Toggle shifts.

spectrum.toggleShifts();

switchPpm

switchPpm: function ()

Switch to Ppm.

spectrum.switchPpm();

switchHz

switchHz: function ()

Switch to Hz.

spectrum.switchHz();

setFull

setFull: function ()

Reset zoom and show full spectrum.

spectrum.setFull();

toggleIntegral

toggleIntegral: function ()

Toggle integral.

spectrum.toggleIntegral();

setSpectrumID

Show spectrum loaded from ChemSpider by internal spectrum ID.

Parameters

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

clear

clear: function ()

Clear all spectra from the widget

spectrum.clear();
resize: function (width,
height)
Resize spectrum widget.
showToolbar: function ()
Show toolbar’s panel.
hideToolbar: function ()
Hide toolbar’s panel.
toggleToolbar: function ()
Toggle toolbar’s panel.
hasMolecule: function ()
Check either rendeted spectrum has molecule or not.
showMolecule: function ()
Show molecule’s panel.
hideMolecule: function ()
Hide molecule’s panel.
toggleMolecule: function ()
Toggle molecule’s panel.
toggleAtomNumbers: function ()
Toggle atom numbers.
toggleShifts: function ()
Toggle shifts.
switchPpm: function ()
Switch to Ppm.
switchHz: function ()
Switch to Hz.
setFull: function ()
Reset zoom and show full spectrum.
toggleIntegral: function ()
Toggle integral.
clear: function ()
Clear all spectra from the widget