retrieve the last plot region etc

18 views
Skip to first unread message

Yuandan Zhang

unread,
Nov 27, 2023, 6:02:04 PM11/27/23
to locuszoom
Hi there 
I did a bit modification on LZ, adding a selection button to change between studies (datasets). Every time after the dataset changed, I want the LZ use the last view-region. How to retrieve the last plot status. 

regards

Yuandan

Andy Boughton

unread,
Nov 28, 2023, 10:45:35 AM11/28/23
to locu...@googlegroups.com
Greetings,

Thanks for the question. There are several versions of LocusZoom, and they don't all share the same code: can you clarify which version you are using? 

If you are asking for help with a specific piece of code, a github link can also be useful. (if the code is public)

-Andy Boughton
abo...@umich.edu


--
You received this message because you are subscribed to the Google Groups "locuszoom" group.
To unsubscribe from this group and stop receiving emails from it, send an email to locuszoom+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/locuszoom/722b394d-cb2f-4d3c-8142-c43724c0dfadn%40googlegroups.com.

Yuandan Zhang

unread,
Dec 18, 2023, 9:15:02 PM12/18/23
to locuszoom
fyi, 

i managed to make it work 

      const stateUrlMapping = {chr: "chrom", start: "start", end: "end"};
      initialState = LzDynamicUrls.paramsFromUrl(stateUrlMapping);
      if (!Object.keys(initialState).length) {
          initialState = {
              chr: CHR,
              start: REGION_MID - 250000,
              end: REGION_MID + 250000,
 
          };
      };
      plot.applyState({ state: initialState });

Reply all
Reply to author
Forward
0 new messages