zakodium-oss / react-ocl Goto Github PK
View Code? Open in Web Editor NEWReact components integrating OpenChemLib
Home Page: https://zakodium-oss.github.io/react-ocl
License: MIT License
React components integrating OpenChemLib
Home Page: https://zakodium-oss.github.io/react-ocl
License: MIT License
I created a wrapper that uses some code changes for an initial data structure. I wanted to update the molFile (or IDCode) and expected that once I updated the value - it automatically re-render the component (and structures), but this never happened. It seems like once you set the initial<something>
it'd never be changed.
I checked the source code but don't see any solutions on how to approach that.
Thoughts?
https://github.com/zakodium-oss/react-ocl/blob/main/src/components/SvgRenderer.js#L78C6-L85
Instead of returning a
It would be better if we insert this component in another SVG.
Functions are not working as tried in ReadMe file
There is the property initialMolfile
that allows to set the molecule when creating the component.
I would need the possibility to change the molecule once the component has been loaded.
Is this possible ? If not it would be a nice feature to have.
I have no problems to add polycycles but trying to change an atom fails. It looks like it adds systematically an atom rather that replace the existing one.
It would be great to have a link to test the future version and check if this issue is solved.
Currently, if we change the size of the editor, it will be reset and lose its state.
Check that the molecule has changed instead of always rendering it
{
"presets": ["react"],
"env": {
"es6": {
"presets": [
["env", {"modules": false}]
]
},
"development": {
"presets": [
"env"
]
}
}
}
When a value is incorrect, such as a non-parseable SMILES. Throw? Warn and show some message?
We should check if there are existing recommendations.
Currently it is possible in the SvgRenderer to highlight some bonds and atoms.
Internally it use 'useHighlight' in order to change the style.
We would need the possibility to annotate the molecule using 'arrows'.
This means:
The coordinates of the center of the atoms can be found by searching the resulting SVG for the corresponding id and searching the cx and cy properties like in :
Once you have based on atom1 and atom2 the from / to of the arraw you should add it in the renderer
New properties in the storybook should be added in order to debug / test this new feature.
NB: Many arrows can be added at the same time
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.