Source files for the List widgets client.
InterMine Generic WebService Client Library from GitHub or InterMine
InterMine List Widgets Client Library from GitHub or InterMine CDN.
A mine that has the desired Enrichment Widget configured.
An API Access Key generated by logging in to MyMine and visiting the
API Key tab, then clicking on Generate a new API key. This assumes
that you do not want to automatically provide the API key as is the
case of within mine embedding that can be seen for example here.
The next step is defining a couple of variables.
Then we define the query whose results will be converted into a list later on.
Now we call the mine converting the results of the query into a list.
Now, in the function
savedList, we can instantiate the List Widgets client and display the result.
The only problem with this approach is that if we make this sort of call multiple times, we will fail on the second and subsequent occasions as we will get a WebService exception telling us that the 'temporary' list name is taken. Thus, inspect the code of the example to see how to make a call to the service to delete/reuse the list if it exists.
In a mine context, List Widgets are configured automatically to e.g. display a Query Results when clicking on "Create a List".
Outside of a mine context, one needs to pass in what happens when one interacts with the Widgets. You can also decide whether to show/hide either/and/or title or description of the widget (for everything else use CSS).
Clicking on an individual match (Gene, Protein etc.) in popover window:
Clicking on View results button in a popover window:
Clicking on Create list button in a popover window:
I want to hide the title or description of a widget: