{"_id":"@complat/chemotion-reaction-svg-composer","_rev":"4-68954f9345035d1923a4de704f8db783","name":"@complat/chemotion-reaction-svg-composer","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@complat/chemotion-reaction-svg-composer","version":"1.0.0","description":"composes svg picture of a reaction out of individual ones and other text components","main":"lib/cjs/index.js","module":"lib/esm/index.js","type":"module","repository":{"type":"git","url":"git+ssh://git@github.com/ComPlat/reaction-svg-composer.git"},"author":{"name":"Markus Wersig","email":"m.wersig@cortona.de"},"license":"MIT","devDependencies":{"@types/jest":"^29.2.3","@typescript-eslint/eslint-plugin":"^5.43.0","@typescript-eslint/parser":"^5.43.0","eslint":"^8.27.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-airbnb-typescript":"^17.0.0","eslint-config-prettier":"^8.5.0","eslint-plugin-import":"^2.26.0","jest":"^29.3.1","jest-canvas-mock":"^2.4.0","jest-environment-jsdom":"^29.3.1","svgdom":"^0.1.10","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.3"},"scripts":{"compile":"yarn run tscEs && yarn run tscCommon","tscEs":"tsc  -p tsconfig.esm.json","tscCommon":"tsc  -p tsconfig.cjs.json","lint":"eslint --fix","start":"node --experimental-json-modules lib/esm/index.js","test":"jest","prepare":"yarn run tscEs && yarn run tscCommon"},"dependencies":{"@svgdotjs/svg.js":"^3.1.2"},"exports":{".":{"import":{"types":"./lib/esm/types/index.d.ts","default":"./lib/esm/index.js"},"require":{"types":"./lib/cjs/types/index.d.ts","default":"./lib/cjs/index.js"}},"./ReactionRenderer":{"import":{"types":"./lib/esm/types/ReactionRenderer.d.ts","default":"./lib/esm/ReactionRenderer.js"},"require":{"types":"./lib/cjs/types/ReactionRenderer.d.ts","default":"./lib/cjs/ReactionRenderer.js"}}},"bugs":{"url":"https://github.com/ComPlat/reaction-svg-composer/issues"},"homepage":"https://github.com/ComPlat/reaction-svg-composer#readme","directories":{"lib":"lib","test":"tests"},"gitHead":"017c44abd4d61c46527f9e01e2c9c8536d7ad2e4","_id":"@complat/chemotion-reaction-svg-composer@1.0.0","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-swtOYBZnO4m2SCcNuBPpRXLIA7s/3HMjx+pNaY4oGb0xB1J33wS4s8FeBh8myryGvlvaTt9DPSmcgUeEnnUgfA==","shasum":"6dccddb37aac8d982ce91b593e1ef0ca2ea3890b","tarball":"https://registry.npmjs.org/@complat/chemotion-reaction-svg-composer/-/chemotion-reaction-svg-composer-1.0.0.tgz","fileCount":218,"unpackedSize":604253,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGXH2ix+tNFSs1RoU4kk+Tn8XRUbxqBYzDMOENMZZnB5AiB0PSIMDMAsyGhsyR5oHiTd2TW3nlZu0Jz9mChlQjq8OA=="}]},"_npmUser":{"name":"pitrem","email":"pierre.tremouilhac@kit.edu"},"maintainers":[{"name":"paggy","email":"pei-chi.huang@kit.edu"},{"name":"cllin","email":"chia-lin.lin@kit.edu"},{"name":"pitrem","email":"pierre.tremouilhac@kit.edu"},{"name":"baolan2005","email":"baolan2005@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chemotion-reaction-svg-composer_1.0.0_1691164093225_0.9719157754531522"},"_hasShrinkwrap":false},"1.1.0":{"name":"@complat/chemotion-reaction-svg-composer","version":"1.1.0","description":"composes svg picture of a reaction out of individual ones and other text components","main":"lib/cjs/index.js","module":"lib/esm/index.js","type":"module","repository":{"type":"git","url":"git+ssh://git@github.com/ComPlat/reaction-svg-composer.git"},"author":{"name":"Markus Wersig","email":"m.wersig@cortona.de"},"license":"MIT","devDependencies":{"@types/jest":"^29.5.3","@typescript-eslint/eslint-plugin":"^6.4.0","@typescript-eslint/parser":"^6.4.0","eslint":"^8.47.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-airbnb-typescript":"^17.1.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.28.0","jest":"^29.6.2","jest-canvas-mock":"^2.5.2","jest-environment-jsdom":"^29.6.2","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.1.6"},"scripts":{"compile":"yarn run tscEs && yarn run tscCommon","tscEs":"tsc  -p tsconfig.esm.json","tscCommon":"tsc  -p tsconfig.cjs.json","lint":"eslint --fix","start":"node --experimental-json-modules lib/esm/index.js","test":"HEADLESS=true jest","prepare":"yarn run tscEs && yarn run tscCommon"},"dependencies":{"@svgdotjs/svg.js":"^3.2.0","svgdom":"^0.1.14"},"exports":{".":{"import":{"types":"./lib/esm/types/index.d.ts","default":"./lib/esm/index.js"},"require":{"types":"./lib/cjs/types/index.d.ts","default":"./lib/cjs/index.js"}},"./ReactionRenderer":{"import":{"types":"./lib/esm/types/ReactionRenderer.d.ts","default":"./lib/esm/ReactionRenderer.js"},"require":{"types":"./lib/cjs/types/ReactionRenderer.d.ts","default":"./lib/cjs/ReactionRenderer.js"}}},"bugs":{"url":"https://github.com/ComPlat/reaction-svg-composer/issues"},"homepage":"https://github.com/ComPlat/reaction-svg-composer#readme","_id":"@complat/chemotion-reaction-svg-composer@1.1.0","dist":{"shasum":"d1a33c8608e7cbd9f5bdf9b8e22de1d41d6775ee","integrity":"sha512-+cWTbO+PADLljl0ejXfxTTC/O3RjszHN2GFgR11y50wizLb6a2he/ygvBXNRkXYwz6tkrj58re5H3rpfx8MbXw==","tarball":"https://registry.npmjs.org/@complat/chemotion-reaction-svg-composer/-/chemotion-reaction-svg-composer-1.1.0.tgz","fileCount":235,"unpackedSize":605624,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBGh5bfZ4/NIXAm6Od4T79EMQYZirpVWIhAX62k1/KPDAiEA78gYuKwqP4+jKORuYCjCPJ+cy2wfWFMa3Dl0ZI0Eumk="}]},"_npmUser":{"name":"pitrem","email":"pierre.tremouilhac@kit.edu"},"directories":{},"maintainers":[{"name":"paggy","email":"pei-chi.huang@kit.edu"},{"name":"cllin","email":"chia-lin.lin@kit.edu"},{"name":"pitrem","email":"pierre.tremouilhac@kit.edu"},{"name":"baolan2005","email":"baolan2005@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chemotion-reaction-svg-composer_1.1.0_1695637024560_0.8770776782773293"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-04T15:48:13.154Z","1.0.0":"2023-08-04T15:48:13.507Z","modified":"2024-03-06T09:55:14.981Z","1.1.0":"2023-09-25T10:17:04.798Z"},"maintainers":[{"email":"pei-chi.huang@kit.edu","name":"paggy"},{"email":"pierre.tremouilhac@kit.edu","name":"pitrem"},{"email":"baolan2005@gmail.com","name":"baolan2005"}],"description":"composes svg picture of a reaction out of individual ones and other text components","homepage":"https://github.com/ComPlat/reaction-svg-composer#readme","repository":{"type":"git","url":"git+ssh://git@github.com/ComPlat/reaction-svg-composer.git"},"author":{"name":"Markus Wersig","email":"m.wersig@cortona.de"},"bugs":{"url":"https://github.com/ComPlat/reaction-svg-composer/issues"},"license":"MIT","readme":"# README\n\n### Setup\n\nyarn add \"reaction-svg-composer\"\n\nadjust following files:\n\nReactionDetails.js\n\n```javascript\n  updateReactionSvg() {\n    const { reaction } = this.state;\n    ReactionSvgFetcher.fetchByReaction(reaction).then((result) => {\n      reaction.reaction_svg_file = result.reaction_svg;\n      this.setState(reaction);\n    });\n  }\n```\n\nReactionSvgFetcher.js\n\n```javascript\nimport { ReactionRenderer, DisplayMatrix } from 'reaction-svg-composer';\nexport default class ReactionSvgFetcher {\n  static fetchByReaction(elnReaction) {\n    return ReactionRenderer.convertELNReaction(elnReaction).then((reactionArray) => {\n      const displayMatrix = DisplayMatrix.createDisplayMatrixFromELNReaction(elnReaction);\n      const rr = new ReactionRenderer(displayMatrix, reactionArray);\n      return { reaction_svg: rr.renderReaction() };\n    });\n  }\n}\n```\n\nElementActions.js\n\n```javascript\n  handleSvgReactionChange(reaction) {\n    return () => {\n      ReactionSvgFetcher.fetchByReaction(reaction).then((result) => {\n        reaction.reaction_svg_file = result.reaction_svg;\n      });\n    };\n  }\n```\n\n### Development\n\nto work locally without building navigate into chemotion_eln\n\n```\nnpm link reaction-svg-composer\n```\n\nnavigate to into reaction-svg-composer and execute\n\n```\nnpm link\nyarn compile\n```\n\n\n## Acknowledgments\n\nThis project has been funded by the **[DFG]**.\n\n[![DFG Logo]][DFG]\n\n\nFunded by the [Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)](https://www.dfg.de/) under the [National Research Data Infrastructure – NFDI4Chem](https://nfdi4chem.de/) – Projektnummer **441958208** since 2020.\n\n\n[DFG]: https://www.dfg.de/en/\n[DFG Logo]: https://www.dfg.de/zentralablage/bilder/service/logos_corporate_design/logo_negativ_267.png\n","readmeFilename":"README.md"}