Skip to content
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

Raw data event improvements #894

Open
ThHarbig opened this issue May 8, 2023 · 1 comment
Open

Raw data event improvements #894

ThHarbig opened this issue May 8, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ThHarbig
Copy link
Collaborator

ThHarbig commented May 8, 2023

In my scenario I have an overview with a brush and a detailed view. I want to get some of the data displayed in the detailed view in order to show it in a table. I'm using this event in the IslandVIewer example:

gosRef.current.api.subscribe('rawData', (type, rawdata) => {
        // get range from highglass API
	const range = gosRef.current.hgApi.api.getLocation(detailID).xDomain
        // filter to get the desired data set for the desired component
	if (rawdata.data.length > 0 && rawdata.id === detailID && 'Accnum' in rawdata.data[0]) {
                // filter by range to get exactly the data displayed in the detailed view
		const dataInRange = rawdata.data.filter(entry => (entry['Gene start'] > range[0] && entry['Gene start'] < range[1]) || (entry['Gene end'] > range[0] && entry['Gene end'] < range[1]))
                // filter out duplicates 
		const uniqueInRange = dataInRange.filter((v, i, a) => a.findIndex(v2 => (v2['Gene name'] === v['Gene name'])) === i)
		setData(uniqueInRange)
	}
});

When using the rawdata event using this function, rawdata has an attribute id and data, to show which data is currently displayed in the view with id. I found some issues with this that I am still trying to explore:

  • The data I get returned for the detailed view is not in the range that I get when retrieving the range manually using the highglass API (related to API for getting the current X domain #845) (Could this be because more data is rendered than displayed for smooth scrolling?)
  • Some elements in the raw data arrays occur multiple times
  • Not only the data for the track is returned but all data from the view.

In general, it would be a great enhancement to make the event listener a bit more fine-grained for example by specifying a view ID and a data set for which the data should be returned. Right now I need to manually filter for both.

@sehilyi
Copy link
Member

sehilyi commented Jul 6, 2023

@ThHarbig Please share with us what issues are remaining for the use case of meta vis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants