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

Allow GO-CAM data to be provided to widget #29

Merged
merged 2 commits into from
Oct 27, 2023
Merged

Allow GO-CAM data to be provided to widget #29

merged 2 commits into from
Oct 27, 2023

Conversation

pkalita-lbl
Copy link
Contributor

Fixes #19

These changes:

  • Prevent automatic data fetching when the gocamId prop is not provided to wc-gocam-viz. Previously the request simply would have failed.
  • Allow a wc-gocam-viz host to pass data directly to it via the new setModelData method.
  • Fix a race condition in initializing dbxrefs. This didn't really surface when the widget always made a request to get the GO-CAM data because that request generally takes much longer than the network request made while initializing dbxrefs. But when the GO-CAM data is already available and provided by the host page the race condition was much more evident.
  • Remove old props (show-gene-product, show-activity) which were removed from wc-gocam-viz some time ago from all examples.

The combination of the first two items allows host pages that already have the GO-CAM data available to simple reuse that instead of making a redundant network request. This will be useful for AmiGO in particular. The new demo/dev page src/local-data.html shows an example of how it works.

The linked issue also talks about the possibility of asking the widget for data that it automatically fetched. But the more I thought about it, the less I saw a clear use case for that. With these changes the rule is clear: if the host page wants the data, it should get the data itself and pass the response to the widget in addition to anything else it want to do with the response.

@pkalita-lbl pkalita-lbl merged commit b299646 into main Oct 27, 2023
1 check passed
@pkalita-lbl pkalita-lbl deleted the issue-19 branch October 27, 2023 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make data fetching and access more flexible
1 participant