The assignment table lists the assigned peaks of an NMR spectrum together with the atoms they belong to. It is linked to the spectrum and to the 3D structure viewer: selecting a row zooms the spectrum to those peaks and highlights the atoms in the structure, and clicking an atom in the structure selects its row. It is available for 1D NMR (SpectraViewer1D) and 2D NMR (SpectraViewer2D).
<atomAssignment> block, parsed by the DataParser with dataType "1D-NMR" or "2D-NMR". The parsed assignments are in event.detail.assignmentData.<div id="assignments">).<structure> in the nmrML and an element with id="mol-3d" (see the 3D Molecular Structure Viewer page).Each row is a cluster (multiplet) of peaks. Pass the assignment data in the assignmentTable option of SpectraViewer1D. clusterNavigationID is required: the table uses the cluster navigator to build its rows and to zoom when a row is clicked.
dataParser.addEventListener("fileParsed", (event) => {
let viewer = new SpectraViewer1D("#graph", {
chartType: "1D-NMR",
chartTitle: { text: "1D NMR Spectrum" },
dataset: [{ name: "Spectrum", dataArray: { x: event.detail.x, y: event.detail.y }, normalize: true, style: { strokeColor: "red" } }],
axis: { x: { reverse: true, label: { text: "Chemical Shift (ppm)" } }, y: { label: { text: "Intensity" } } },
grid: { horizontal: {}, vertical: {} },
controls: { options: { zoom: {} } },
assignmentTable: {
containerID: "#assignments",
clusterNavigationID: "#cluster-navigation",
data: [event.detail.assignmentData],
structure: {}, // also show the 3D structure in #mol-3d
},
});
});The No. H's and Atom No. columns are only shown when a structure is available.
Each row is a cross peak. 2D nmrML files list the assignments as consecutive pairs of multiplets, one per dimension (e.g. the 1H multiplet followed by the 13C multiplet of an HSQC cross peak); the DataParser pairs them into cross peaks. Pass the data in the assignmentTable option of SpectraViewer2D.
dataParser.addEventListener("fileParsed", (event) => {
let viewer = new SpectraViewer2D("#graph", {
width: 800,
height: 800,
dataset: { dataArray: { x: event.detail.x, y: event.detail.y, z: event.detail.z } },
assignmentTable: {
containerID: "#assignments",
data: [event.detail.assignmentData],
structure: {}, // also show the 3D structure in #mol-3d
},
});
});For 1H-X cross peaks the hydrogens shown are the ones bonded to the assigned heavy atom in the structure. Hydrogen labels in the file are only used as-is when they refer to hydrogens on that atom, since some files number hydrogens differently from the atom list.
CSS selector of the element that will contain the table.
string | required [event.detail.assignmentData] from the DataParser.
1D only. CSS selector of the cluster navigation element.
string | required for 1DInclude this key (e.g. structure: {}) to show the 3D structure viewer. Structure display options are listed on the 3D Molecular Structure Viewer page.
1D only. The observed nucleus; sets the "No. H's" / "No. C's" column.
string | default: "1H"