Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't convert to smiles for smarts svg drawing #90

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@iktos-oss/molecule-representation",
"version": "1.7.1",
"version": "1.7.2",
"description": "exports interactif molecule represnetations as react components",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand Down Expand Up @@ -45,7 +45,7 @@
"author": "Ramzi Oueslati <ramzi.oueslati@iktos.com>",
"devDependencies": {
"@babel/core": "^7.20.12",
"@iktos-oss/rdkit-provider": "^2.6.0",
"@iktos-oss/rdkit-provider": "^2.6.2",
"@rdkit/rdkit": "^2023.9.2-1.0.0",
"@storybook/addon-actions": "^6.5.16",
"@storybook/addon-essentials": "^6.5.16",
Expand Down Expand Up @@ -80,7 +80,7 @@
"serve": "^14.2.0"
},
"peerDependencies": {
"@iktos-oss/rdkit-provider": "^2.6.0",
"@iktos-oss/rdkit-provider": "^2.6.2",
"@rdkit/rdkit": "^2023.9.2-1.0.0",
"react": ">=17.0.2",
"react-dom": ">=17.0.2"
Expand Down
5 changes: 3 additions & 2 deletions src/utils/draw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

import { RDKitColor, getSvgFromSmarts } from '@iktos-oss/rdkit-provider';
import {
getSvg,
getMoleculeDetails,
getCanonicalFormForStructure,
getMatchingSubstructure,
getSvgFromSmarts,
RDKitColor,
} from '@iktos-oss/rdkit-provider';
import { AlignmentDetails } from '../components';
import { HIGHLIGHT_RDKIT_COLORS, TRANSPARANT_RDKIT_COLOR } from '../constants';
Expand Down Expand Up @@ -97,6 +97,7 @@ export const get_svg_from_smarts = async (params: DrawSmartsSVGProps, worker: Wo
structure: params.smarts,
useQMol: true,
});

if (!canonicalSmarts) return null;

const { svg } = await getSvgFromSmarts(worker, {
Expand Down
Loading