-
Notifications
You must be signed in to change notification settings - Fork 135
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
Add text to a view #626
Comments
Hello @hainm ! |
@arose: any idea? Thanks. |
To some extent you can use the zOffset parameter. If that is larger than the bounding radius of your models then all text will be rendered in front. |
and may be |
@arose Sorry for the late reply. Another question is why this atom label (I mean at the left corner of the screenshot) is not rendered if I want to save the image? |
The label is not rendered in screenshots because its is not part of the 3d scene but a simple html element. As far as I know there is no API to add html to the widget but maybe @hainm has an idea. Btw. Is that structure in the PDB archive? The protein look interestingly symmetric. |
@arose Ok, got it. |
There is no API to add HTML yet, but there's a hacky way to do it by using code = """
$("<div></div>")
.css("position", "absolute")
.css("top", "5%")
.css("left", "3%")
.css("background-color", "white")
.css("padding", "2px 5px 2px 5px")
.css("opacity", "0.7")
.appendTo(this.$container);
"""
view._execute_js_code(code) You need to play around with this to add your own text. good luck. |
Thank, looks like there is local C2 symmetry, made a snapshot https://molstar.org/viewer/?snapshot-url=https%3A%2F%2Fwebchem.ncbr.muni.cz%2Fmolstar-state%2Fget%2F5de7da28-c560-4dc0-8c31-fce8f383348b |
@hainm Thanks for the great example! |
Any progress on a 'add_title' method? The above did not work for me. |
have you tried in the traditional notebook yet? |
I havent... but I'm never going to use the trad notebook. I've drunk the jupyterlab kool-aid ;-) |
jupyterlab was not pleasure to work with in 2017 when this topic was opened, so we have not revisited the lab yet. |
Understood. But my feeling is that jupyterlab is definitely the weapon of choice for most. Its the logical progression through the years of python cmd line ---> ipython cmd line ---> jupyter notebook ---> jupyterlab notebook. I dont think there's any going back. I'd love NGLView to have better integration because Chemistream leans heavily on your great library, and Chemistream is exclusively jupyterlab for UI |
yeah, I agree with you about jupyterlab. I had more free time when I was a postdocs to work on nglview than nowadays. |
Copy that... I hear ya brother ;-) |
cc @kain88-de
The text was updated successfully, but these errors were encountered: