{"id":15018324,"url":"https://github.com/iktos/molecule-representation","last_synced_at":"2025-10-23T18:30:17.049Z","repository":{"id":65495600,"uuid":"592354447","full_name":"iktos/molecule-representation","owner":"iktos","description":"Interactif molecule representations / drawing as react components","archived":false,"fork":false,"pushed_at":"2025-02-07T14:24:38.000Z","size":4916,"stargazers_count":8,"open_issues_count":3,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-07T14:57:50.100Z","etag":null,"topics":["cheminformatics","chemistry","molecule-viewer","rdkit","react","typescript"],"latest_commit_sha":null,"homepage":"https://molecule-representation-ramziweslati.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iktos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-23T14:56:35.000Z","updated_at":"2025-01-28T20:58:56.000Z","dependencies_parsed_at":"2024-03-06T21:52:16.844Z","dependency_job_id":"481fe160-e480-4025-a8d5-a7842504c135","html_url":"https://github.com/iktos/molecule-representation","commit_stats":{"total_commits":100,"total_committers":5,"mean_commits":20.0,"dds":0.12,"last_synced_commit":"8172c1c16aba6575676fcab9d9c4110d7205f657"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktos%2Fmolecule-representation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktos%2Fmolecule-representation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktos%2Fmolecule-representation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktos%2Fmolecule-representation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iktos","download_url":"https://codeload.github.com/iktos/molecule-representation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237869122,"owners_count":19379269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cheminformatics","chemistry","molecule-viewer","rdkit","react","typescript"],"created_at":"2024-09-24T19:51:49.830Z","updated_at":"2025-10-23T18:30:16.592Z","avatar_url":"https://github.com/iktos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# molecule-representation\n\nReact components for interactive 2D molecule representation rendering.\n\n## Demo  \nVisit https://molecule-representation-ramziweslati.vercel.app for a demo of the package, you can browse the diffrent options like molecule representations with zoom, click handler, substructure alignement...\n\n Deployments are automated via [Vercel](https://vercel.com).\n## Usage\n\n#### Initial setup  \n\n1- First follow [the @iktos-oss/rdkit-provider setup](https://github.com/iktos/rdkit-provider?tab=readme-ov-file#setup).\n\n2- Wrap your components in an RDKit provider from [@iktos-oss/rdkit-provider](https://github.com/iktos/rdkit-provider)\n\n```html\nimport { RDKitProvider } from '@iktos-oss/rdkit-provider';\n\u003cRDKitProvider\u003e\n  \u003cComponent /\u003e\n\u003c/RDKitProvider\u003e`\n```\n\n3- For better preformance we recommend enabling the caching of rdkitjs JsMol instances, this can be done using RDKitProvider\n```html\nimport { RDKitProvider } from '@iktos-oss/rdkit-provider';\n\u003cRDKitProvider  cache={{ enableJsMolCaching: true, maxJsMolsCached: 30 }}\u003e\n  \u003cComponent /\u003e\n\u003c/RDKitProvider\u003e`\n```\n\n#### Rendering molecules\n\n```js\nimport { MoleculeRepresentation, MoleculeRepresentationProps } from '@iktos-oss/molecule-representation';\nconst props: MoleculeRepresentationProps = {\n  smiles: 'Cc1cccc(-c2ccccc2)c1',\n  addAtomIndices: true,\n  bondsToHighlight: [\n    [1, 0],\n    [3, 4],\n  ],\n  atomsToHighlight: [\n    [1, 0],\n    [3, 4],\n  ],\n  atomsStyles: {\n    default: { fill: 'green' },\n    1: { fill: 'red' },\n  },\n  bondsStyles: {\n    default: { stroke: 'black', 'stroke-width': '1px' },\n    '0-1': { stroke: 'green', 'stroke-width': '2px' },\n    '4-*': { 'stroke-width': '3px' },\n    '*-6': { 'stroke-width': '4px' },\n    '6-*': { 'stroke-width': '2px' },\n  },\n  height: 200,\n  width: 300,\n  onAtomClick: (atomId: string) =\u003e console.log(\"clicked atoms idx:\", atomId),\n  onBondClick: (bondIdentifier: ClickedBondIdentifiers) =\u003e {\n    console.log(\"clicked bond idx:\", bondIdentifier.bondId)\n    console.log(\"clicked bond starting atom idx:\", bondIdentifier.startAtomId)\n    console.log(\"clicked bond ending atom idx:\", bondIdentifier.endAtomId)\n  }\n  zoomable: true\n};\n\u003cMoleculeRepresentation {...props} onAtomClick={} /\u003e\n```\n\n## Local dev\n```bash\n    git clone https://github.com/iktos/molecule-representation.git\n    cd molecule-representation\n    npm install\n    npm run storybook\n```  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiktos%2Fmolecule-representation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiktos%2Fmolecule-representation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiktos%2Fmolecule-representation/lists"}