version identification and inchi-to-structure for JavaScript #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request shares the inchi-web.c code modified for openchemlib (OCL-SwingJS), Jmol-SwingJS, JME-SwingJS (which is incorporated into Jmol-SwingJS), and CDK-SwingJS.
It adds two significant features to INCHI-WEB-DEMO:
a "version" JSON key to go along with message, log, return_code for all methods, that reports the full APP_DESCRIPTION of inchi c, such as:
InChI version 1, Software 1.07.2 (inchi-1 executable)
as demonstrated at SimpleDemo/index1.html
as demonstrated at at SimpleDemo/index1.html and SimpleDemo/index.html
Item 1 is going to be particularly useful as inchi-web-WASM becomes more widely available, and we start seeing different implementations with a range of InChI versions out there. The savvy user wants to know what version of InChI is being accessed.
Item 2 is particularly useful when inchi-web.wasm is coupled with larger packages, complementing the feature of Java JNA-InChI in JavaScript. For example, at CDK-SwingJSTest_core we see a simple case starting with
CDK-SwingJS/JavaScript delivers the SMILES:
using this sequence (written in Java, but executed in JavaScript in a browser):
InChI to model to molecule
molecule to SMILES
In addition, the following bits of code generated PNG and SVG images in JavaScript:
(PNG)
(SVG)