* Make kekulization deterministic * Add tautomer order-independence regression (python) * Adjust tautomer tests for deterministic kekulization * Update graphmol wedged-bond kekulization checks * SmilesParse: update aromatic bond index expectations * SmilesParse: refresh cxsmilesTest expected files * Depictor: update testDepictor expected MolBlocks * Depictor: update depictorCatch expectations * Depictor Wrap: update expected MolBlock for pyDepictor * MarvinParse: update testMrvToMol expected outputs * FileParsers: refresh testAtropisomers expected outputs * FileParsers: update tests for deterministic kekulization * MolDraw2D: refresh brittle bond assertions * RascalMCES: update expected cluster size * MinimalLib: make cffi wedging check order-independent * documentation fix * MinimalLib: update Kekulé bond table in aligned-coords test * Hoist duplicated lambdas to TEST_CASE scope * Remove unused originalWedges variable * Remove redundant bounds check; clarify wedge-end preference * Pre-sort allAtms by wedge-end + rank * Use mol.atomNeighbors() for neighbor iteration * Check inAllAtms before linear-scanning done * Drop redundant optsV/wedgedOptsV sorts * Remove unused Canon.h include * Add canonical parameter to Kekulize; skip ranking during sanitization * Test canonical re-kekulization preserves stereo across atom orderings * MinimalLib: update Kekulé bond orders in invertedWedges * Change Kekulize canonical default to false, expose in Python wrappers * keep rank order, push_back * Revert "RascalMCES: update expected cluster size" This reverts commita81bb39495. * docstring change * expose new flag to python wrapper * document changes in ReleaseNotes.md * revert minimallib test changes again * canonical = true defaults * Revert "revert minimallib test changes again" This reverts commit039e1d84da. * Reapply "RascalMCES: update expected cluster size" This reverts commit7b83a7a3e8. --------- Co-authored-by: greg landrum <greg.landrum@gmail.com>
IMPORTANT NOTE:
The NPM release process has now moved to the official repository of rdkit-js.
The official rdkit-js repository will now be the centralized place for everything built "on top of" the core RDKit MinimalLib source code (this repository). Please read this for more context.
RDKit MinimalLib
Table of contents
Introduction
The idea of the MinimalLib is to allow the RDKit to be used from JavaScript so that we can add chemical capabilities to web applications.
This initial set of functionality does not cover all of RDKit's functionality, but it is intended to be directly useful.
Install
The most popular way of installing the MinimalLib is with NPM.
npm i @rdkit/rdkit
# yarn add @rdkit/rdkit
To build the MinimalLib manually, refer to this section.
Usage
Using the RDKit package assets
Option 1: Use the npm package distribution files
Once you have the RDKit package installed in your node modules, copy the following distribution files anywhere in your deployed assets.
node_modules/@rdkit/rdkit/dist/RDKit_minimal.jsnode_modules/@rdkit/rdkit/dist/RDKit_minimal.wasm
NOTE: Both files must be copied at the same location in your deployed assets for the library to work properly.
Option 2: Use the remote distribution files from unpkg.com
https://unpkg.com/@rdkit/rdkit/dist/RDKit_minimal.jshttps://unpkg.com/@rdkit/rdkit/dist/RDKit_minimal.wasm
Option 3: Build your own distribution files
For this method, refer to Building the MinimalLib.
Running RDKit in your JavaScript code
To use RDKit, load the javascript file and instantiate the wasm module inside the head tag of your index.html, before you run your application code:
<head>
<!-- ...other files and HTML tags... -->
<!-- Load the RDKit JS file -->
<script src="https://unpkg.com/@rdkit/rdkit/Code/MinimalLib/dist/RDKit_minimal.js"></script>
<!-- Instantiate the WASM module. The inline script below could live elsewhere inside your application code. -->
<script>
window.initRDKitModule()
.then(function(RDKit) {
console.log("RDKit version: " + RDKit.version());
window.RDKit = RDKit;
/**
* The RDKit module is now loaded.
* You can use it anywhere.
*/
})
.catch(() => {
// handle loading errors here...
});
</script>
<!-- ...your application code goes here... -->
</head>
Live demos
If you are using the MinimalLib for the first time, see the getting started examples at https://www.rdkitjs.com/ .
All live demos
- RDKit.js website: https://www.rdkitjs.com/
- RDKit.js usage with React.js: https://react.rdkitjs.com/
- Legacy examples #1: https://unpkg.com/@rdkit/rdkit/dist/GettingStartedInJS.html
- Legacy examples #2: https://unpkg.com/@rdkit/rdkit/dist/demo.html
Building the MinimalLib
Building from Github
Make sure you are at the root of the MinimalLib, and run the following script:
scripts/build_rdkitjs.sh <RDKit git release tag name>
# Example: scripts/build_rdkitjs.sh Release_2025_03_2
This command will take several minutes to complete, and will default to using the master branch if no version is provided. Also, checkout the build_rdkitjs.sh file to see how things are tied together.
Building from the local source tree
Make sure you are at the root of the MinimalLib, and run the following script:
GET_SRC=copy_from_local scripts/build_rdkitjs.sh
This command will take several minutes to complete, and will use the local source tree
Using the RDKit package assets
Once you have verified that the distribution files have been properly added in Code/MinimalLib/dist, refer to the Using the RDKit package assets section for the next steps.