Skip to content

Instantly share code, notes, and snippets.

@ahmohamed
Last active October 16, 2015 22:37
Show Gist options
  • Save ahmohamed/7d1f9a9d016959b0905e to your computer and use it in GitHub Desktop.
Save ahmohamed/7d1f9a9d016959b0905e to your computer and use it in GitHub Desktop.
Specdraw: read jcamp-dx file

This example demonstrate using SpecdrawJS to handle jcamp-dx files easily. Proton spectrum of indomethacin is obtained from a URL and processed in the browser. The App offers full interactivity with the data.

For details about SpecdrawJS.

For more examples see NMRPro.

<!DOCTYPE html>
<meta charset="utf-8">
<title>SpecdrawJS: Full client-side mode - SampleSet spectra</title>
<link rel="stylesheet" href="https://rawgit.com/ahmohamed/specdraw.js/master/specdraw.min.css" type="text/css">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="https://rawgit.com/ahmohamed/specdraw.js/master/specdraw.js"></script>
<style type="text/css">
#container {
width:960px;
height:500px;
}
</style>
<body>
<div id="container"></div>
<script>
var spec_app = specdraw.App()
.data('https://rawgit.com/cheminfo-js/jcampconverter/master/test/data/indometacin/1h.dx');
d3.select('#container').call(spec_app);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment