lukasturcani / moldoc

Make better chemistry documentation!
MIT License
14 stars 0 forks source link

Configuration enhancements: Custom default zoom, box size and position #13

Open TimoSommer opened 1 day ago

TimoSommer commented 1 day ago

Hey Lukas,

me again, this time with an enhancement proposal.

I noticed that for small molecules, like many molecules in the stk documentation, the default zoom for moldoc works very well to display the molecule in a perfect size. However, for larger molecules, for example molecular complexes such as the ones in my DARTassembler docs, I find myself zooming in for every molecule because the default zoom makes the molecules appear very small. I might even set the zoom so that some outer atoms are not shown immediately, in order to have the main part of the molecule shown big enough. To counter this issue, it would be great to have a configuration option where you could set an initial zoom different than the one applied at the moment.

At the same time, I think it would be very cool to be able to choose a different box size as well. The boxes seem to always be relatively small in height. However, for large molecules such as molecular complexes, it might be nice to have it in a bigger box, such that it is possible to view it in large.

A third thing, but I don't know if that's possible or too difficult: It would be nice to be able to have multiple moldoc boxes next to each other, in order to make better use of the available space. For example, in my documentation, I show three example complexes, which in a 2D figure originally I had side-by-side (see picture below). Now with moldoc, I have them underneath each other, which looks a little awkward (see docs above).

None of this is critical of course, just some small ideas. Thank you very much for making and maintaining this amazing package! picture_with_filtering

lukasturcani commented 1 day ago

Hi Timo! Thank you, these are great ideas! It may take me a little bit of time to implement as I wrote the main dependency of moldoc, https://github.com/lukasturcani/mol-draw, in Purescript, which I don't really want to continue using (adds too much complexity / overhead to my development workflow).

To implement these suggestions I'd have to either update mol-draw (which would mean rewriting it in a language id prefer to use like typescript or Rust) or replace it as a dependency. The last time I've considered doing this I wanted to repalce mol-draw with https://github.com/3dmol/3Dmol.js . which would provide way more features out of the box. So that is my preferred approach.

Importantly -- regardless of which approach I take it will mean breaking changes to moldoc, so if you have it as a dependency make sure you add it as moldoc<4 else you may break suddenly when I make these changes.

Let me know if you have thoughts on these proposals

TimoSommer commented 1 day ago

Thanks for the quick answer! I have pinned the moldoc version as suggested. For the implementation, unfortunately I have no experience with either tool or language, so sadly I won't be of much help here. But please let me know if there's any further development on this issue!

lukasturcani commented 22 hours ago

If the moldoc_display_molecule variable required an rdkit Molecule, would that make your life easier, harder or make no difference?

TimoSommer commented 21 hours ago

In general, it would be more difficult than now, but not impossible. I found the current process of just specifying atoms and bonds very straightforward, especially because it also gave me the opportunity of ignoring bond orders by just specifying all bond orders as 1. With rdkit, it's always a struggle to make things work because it likes to complain about bond orders, but with the trick from https://github.com/lukasturcani/stk/issues/531, it should work as well. However, it might not be possible anymore then to ignore the bond orders, which I think is a very nice property since these are not always specified.