cbouy / mols2grid

Interactive molecule viewer for 2D structures
https://mols2grid.readthedocs.io
Apache License 2.0
207 stars 25 forks source link

Add custom transform functions. Would solve #10. #12

Closed fredrikw closed 3 years ago

fredrikw commented 3 years ago

This is an example implementation of how to solve #10. The demo notebook contains code that use features in RDKit 2021.3 that I commented out since I haven't upgraded yet. Please feel free to uncomment those and rerun the notebook :-) While implementing I realised that there is a choice to make if one should format or style first. I opted to apply the format after the styling code...

cbouy commented 3 years ago

@fredrikw I like your idea of passing a callable, that would bring more flexibility, although I'm not sure the support of format strings is even necessary at that point. It would be easier (and probably clearer) to just support functions. I'll make the changes and update the demo and readme Thanks again!