Closed sir4ur0n closed 2 years ago
Hmm. This does appear to be an oversight, but can be changed. Over time, we've added more support for external control over the plot, which has meant adding support for the idea that the value can be changed in more than one way.
I've pushed a commit showing how this is done, and, actually doing it as a default feature of the set_state
widget. It's not part of an official release yet, though it should mostly work for your needs. I'll try to make time for more thorough testing in the next week ish.
https://github.com/statgen/locuszoom/commit/1bdbc019357db351d264557d6b023c97d0e1a929
Internally, the key idea is that many changes are communicated by events, so an update can be achieved by listening to state_changed
events.
@abought thank you so much for the fast answer and fix :bow:
For what it's worth, I gave it a shot using npm install https://github.com/statgen/locuszoom
and I confirm it works in my use case now :+1:
Thanks! If you ever release your tool publicly, I'd be curious to take see how people are using LZ in the wild. :) Some day it would be nice to create an example gallery.
The code is currently closed-source but I mentioned your question to our stakeholders, we might make it open or partially open source in the future, I/we will let you know!
Open source would certainly be an extra bonus! I had been thinking of just a URL- showcasing different ways that people present their public datasets. It's nice to see what features people find useful, and I'll often try to invest extra effort improving what people use most.
Open source is nice, but I'm also a big fan of open data. I admit this is not always easy to pull off- we depend on our scientific collaborators to find the right balance for their patients and colleagues.
Good luck with your projects! Let us know if we can ever assist or improve the tools available to the community.
Currently it seems that a set_state widget is a one-way binding: a selection from the user changes the state.
However the reverse binding does not happen: when the state changes, it is not reflected back in the widget selected/displayed value.
My use case: I have a state field (in this case,
chr
) which can either be selected directly by the user (using theset_state
widget), or which can be updated by JS code if the user selects another gene in a custom field (e.g. switching from geneTMEM18
(chromosome 2) toTERT
(chromosome 5) updatesstate.chr
, but the widget still displays2
).