Allow GO-CAM data to be provided to widget #29
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #19
These changes:
gocamId
prop is not provided towc-gocam-viz
. Previously the request simply would have failed.wc-gocam-viz
host to pass data directly to it via the newsetModelData
method.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 initializingdbxrefs
. But when the GO-CAM data is already available and provided by the host page the race condition was much more evident.show-gene-product
,show-activity
) which were removed fromwc-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.