-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/nglview tooltip #600
Feat/nglview tooltip #600
Conversation
Codecov Report
@@ Coverage Diff @@
## master #600 +/- ##
==========================================
+ Coverage 90.25% 90.26% +<.01%
==========================================
Files 48 49 +1
Lines 3696 3707 +11
==========================================
+ Hits 3336 3346 +10
- Misses 360 361 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool! I had a comment or two, but no changes.
Did you run into any issues installing and using nglview to visualize any compounds?
The reason we made default py3dmol was due to a lot of us having issues where the visualizations never appeared, which appeared to be a mix of issues ranging from the Jupyter widgets themselves, to having to delete certain folders that the widgets were using.
Can you try making a new anaconda env, using the default installed nglview, and see if you run into any visualization issues? With your knowledge of JS, you might be able to discover something we missed.
Ill try it on my machine too, and see what happens
LGTM!
""" | ||
this.stage.mouseControls.add('hoverPick', (stage, pickingProxy) => { | ||
let tooltip = this.stage.tooltip; | ||
if(pickingProxy && pickingProxy.atom && !pickingProxy.bond){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to satisfy my curiosity, if we support more features from nglview, would this args
section essentially be extended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It depends on the type of support nglview
has in the future. If they have additional python methods in the future, we wouldn't have to rely on this js
call. There are a lot of features in ngl
which cannot be implemented directly from nglview
without firing js
.
@justinGilmer As of right now @ahy3nz ran this branch in conda create -n nglview-test
conda activate nglview-test
conda install -c conda-forge nglview
conda install nglview -c conda-forge
jupyter nbextension enable --py --sys-prefix widgetsnbextension
jupyter nbextension enable --py --sys-prefix nglview
jupyter notebook Python version 3.7 |
It's uncommon to see user getting issue with |
I think on previous attempts with nglview, I've tried something similar with the removals
|
hi @ahy3nz: Do you mind trying it now with a fresh conda env and the latest If the widget is not shown, can you please post the Javascript console (Chrome: Right click -> Inspect -> Console). Thanks. |
oh, @ahy3nz you are right. Jupyter use that |
Once this is resolved, the issue won't happen with future versions since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me with nglview and showing atom indices in the hover tooltip, I don't know if you also wanted to put atom indices in the upper-left text when you click on an atom. I'll also observe that residue/compound naming won't work in the visualizer because the mb.compound
is implicitly converted to a mdtraj.Trajectory
or pmd.Structure
with no kwargs for residues
to specify residue names, and the resultant mol2
file has no residue names besides the default RES
Seems doable to me. (01084f5)
So, according to ngl/fileformats, basically all of our writers are supported by |
I had some issues with juypter lab but following the steps here: nglviewer/nglview#845 I was able to get it to work! |
I also got The Lennard Jones example worked so I'm guessing this isn't an issue with having custom element types. |
Feat/nglview tooltip
PR Summary:
To address #443, this PR makes the following contributions:
overwrite_nglview_default
in the filejsutils
forjs
tooltip behavior modificationsatom.index
, fromngl
as the feature.PR Checklist
Some Examples:
![image](https://user-images.githubusercontent.com/11476842/66216937-037f6000-e68c-11e9-955d-f3e5fcbccb25.png)