dalliance
dalliance copied to clipboard
More flexible search API
Browser.search is only really suitable as a hook for the Browser chrome. A final API should:
- Return match data to the caller, rather than triggering immediate browser navigation.
- Allow control of which track(s) are queried.
- Provide better support for ambiguous matches.
Where is Browser.search documented?
Per the original message, the current Browser.search is fairly specifically a hook for the "genome browser chrome" core, rather than a flexible API for running arbitrary searches. I'm still interested in replacing/augmenting it.
If you're interested, the currrent API takes two parameters:
- A search string
- A callback that's invoked in case of error.
If there's an error or no matches, you'll get a message returned to the callback. Otherwise, the browser will interrogate all currently-active tracks which provide a search capability (in practice, generally bigBed tracks with extra indices), and navigate directly to the region matching the search query. The "direct navigation" aspect is annoying, hence interest in a new API which returns search results rather than triggering navigation.