List Widgets Questions & Answers
#
Source filesSource files for the List widgets client.
#
Using a temporary list on the fly#
RequirementsInterMine Generic WebService Client Library from GitHub or InterMine
CDN.
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.
#
CodeFirst require the JavaScript libraries needed to run the example. You probably have your own version of a Twitter Bootstrap compatible CSS style included on the page already.
The next step is defining a couple of variables.
Now we connect with the mine through InterMine JavaScript Library.
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.
#
Defining custom actions on widget eventsIn 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:
#
Showing a Results TableThe example below assumes that you have resolved all Query Results dependencies and have a PathQuery in JSON/JavaScript format that you want to display in a #container
: