Bundle development for chimeraX - svg onClick event to run command from QWebEngineView

Hello, I am currently working on a privateer bundle for carbohydrate validation in chimeraX. At present, I have it so that the privateer tool will display SNFGs of glycans present in the structure using svgs displayed in a QWebEngineView(). I would like, if possible, on clicking elements of the svg to run a chimeraX command (view /chainID:resID) to centre the view window on the residue in question. At present, I can implement an onClick event to display the command that should be run, but haven't managed to figure out how to just run the command from within that QWebEngineView. Is there a mechanism already in place for doing something like this that I could take advantage of? I'd considered using the "log html" to display the svgs in the log instead of the WebEngineView() so that I could take advantage of the href="cxcmd" functionality, but the svgs are long, with semicolons and new-line characters which interfere with this. Best wishes, Lou Holland (Pronouns: they/them) Research Associate York Structural Biology Laboratory, Department of Chemistry, University of York, Heslington, YO10 5DD, York, UK

Answered on chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> since this was a ChimeraX question, see: <https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/...>
On Feb 18, 2025, at 5:11 AM, Lou Holland via Chimera-dev <chimera-dev@cgl.ucsf.edu> wrote:
Hello,
I am currently working on a privateer bundle for carbohydrate validation in chimeraX. At present, I have it so that the privateer tool will display SNFGs of glycans present in the structure using svgs displayed in a QWebEngineView().
I would like, if possible, on clicking elements of the svg to run a chimeraX command (view /chainID:resID) to centre the view window on the residue in question. At present, I can implement an onClick event to display the command that should be run, but haven't managed to figure out how to just run the command from within that QWebEngineView. Is there a mechanism already in place for doing something like this that I could take advantage of?
I'd considered using the "log html" to display the svgs in the log instead of the WebEngineView() so that I could take advantage of the href="cxcmd" functionality, but the svgs are long, with semicolons and new-line characters which interfere with this.
Best wishes, Lou Holland (Pronouns: they/them)
Research Associate York Structural Biology Laboratory, Department of Chemistry, University of York, Heslington, YO10 5DD, York, UK _______________________________________________ Chimera-dev mailing list -- chimera-dev@cgl.ucsf.edu To unsubscribe send an email to chimera-dev-leave@cgl.ucsf.edu

Answer part two: <https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/...> (you can follow the thread on the chimerax-users archive if there are any more answers!)
On Feb 18, 2025, at 10:44 AM, Elaine Meng via Chimera-dev <chimera-dev@cgl.ucsf.edu> wrote:
Answered on chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> since this was a ChimeraX question, see:
<https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/...>
On Feb 18, 2025, at 5:11 AM, Lou Holland via Chimera-dev <chimera-dev@cgl.ucsf.edu> wrote:
Hello,
I am currently working on a privateer bundle for carbohydrate validation in chimeraX. At present, I have it so that the privateer tool will display SNFGs of glycans present in the structure using svgs displayed in a QWebEngineView().
I would like, if possible, on clicking elements of the svg to run a chimeraX command (view /chainID:resID) to centre the view window on the residue in question. At present, I can implement an onClick event to display the command that should be run, but haven't managed to figure out how to just run the command from within that QWebEngineView. Is there a mechanism already in place for doing something like this that I could take advantage of?
I'd considered using the "log html" to display the svgs in the log instead of the WebEngineView() so that I could take advantage of the href="cxcmd" functionality, but the svgs are long, with semicolons and new-line characters which interfere with this.
Best wishes, Lou Holland (Pronouns: they/them)
Research Associate York Structural Biology Laboratory, Department of Chemistry, University of York, Heslington, YO10 5DD, York, UK _______________________________________________ Chimera-dev mailing list -- chimera-dev@cgl.ucsf.edu To unsubscribe send an email to chimera-dev-leave@cgl.ucsf.edu
_______________________________________________ Chimera-dev mailing list -- chimera-dev@cgl.ucsf.edu To unsubscribe send an email to chimera-dev-leave@cgl.ucsf.edu
participants (2)
-
Elaine Meng
-
Lou Holland