Widgets
There are several widgets available on the InterMine list analysis page, and they are configured in webconfig-model.xml.
There are three categories of widget: table, graph, and enrichment widgets.
| widget type | purpose | requirements |
| table | displays the counts from the list for the collection specified | update config file |
| graph | displays a chart based on a dataset you specify | update config file, query written in java |
| enrichment | displays the p-values of objects that appear in your list | update config file, query written in java |
Table widgets
Table widgets display objects and the counts of related objects in your list.
To create a table widget, follow these two steps:
- Configure the widget in webconfig-model.xml
attribute purpose example id unique id used by javascript only unique_id pathStrings which collection to use in the widget Gene.proteins exportField which field from the objects in your list to export primaryIdentifier typeClass types of lists that should display this widget org.flymine.model.genomic.Gene
optional attributes
attribute purpose title appears at the top of the widget description description of the widget displayFields which fields from the objects in the collection (in the above example, Gene.proteins) to display, eg. primaryAccession columnTitle heading for the "count" column externalLink link displayed next to first column, identifier will be appended to link externalLinkLabel label for external link link what query to run when the user clicks on the widget (see below)
- Create a Java class for links from the widget (optional)
- Create new java class, eg EmployeeURLQuery.java
- Update generatePathQuery() method with the correct paths
- Add name of new class to config as link, eg link="org.intermine.model.testmodel.web.widget.EmployeeURLQuery"
Graph widgets
Graph widgets display datasets in graphical format.
To create a graph widget, follow these two steps:
- Configure the widget in webconfig-model.xml
attribute purpose example id unique id used by javascript only unique_id dataSetLoader Java class that retrieves the data displayed in the chart org.flymine.web.widget.FlyAtlasDataSetLdr typeClass types of lists that should display this widget org.flymine.model.genomic.Gene
optional attributes
attribute purpose example title appears at the top of the widget Chromosome Distribution description description of the widget Actual: number of items in this list found on each chromosome. Expected: given the total number ... domainLabel Label displayed on x-axis Chromosome rangeLabel Label displayed on y-axis Count graphType which type of chart to render BarChart (default) or StackedBarChart link what query to run when the user clicks on the widget org.flymine.web.widget.FlyAtlasGraphURLGenerator extraAttributeClass currently only used to add organism org.intermine.bio.web.logic.BioUtil
- Write Java classes
class purpose example DataSetLoader Retrieves the data to be rendered in the chart. org.flymine.web.widget.FlyAtlasDataSetLdr URLGenerator (optional) Generates the URLs assigned to each bar on the chart org.flymine.web.widget.FlyAtlasGraphURLGenerator
NOTE: The graphs use a Java library called JFreeChart. Currently only BarCharts and StackedBarCharts are supported.
Enrichment widgets
Enrichment widgets display the p-values of objects that appear in your list. See EnrichmentWidgets for more information on how the p-value is calculated.
To create an enrichment widget, follow these two steps:
- Configure the widget in webconfig-model.xml
attribute purpose example id unique id used by javascript only unique_id typeClass types of lists that should display this widget org.flymine.model.genomic.Gene dataSetLoader Java class that retrieves the data displayed in the widget org.intermine.bio.web.widget.PublicationLdr
optional attributes
attribute purpose title appears at the top of the widget description description of the widget label heading for the column externalLink link displayed next to first column externalLinkLabel label for external link filters extra filters to add to the display filterLabel label for filter form field link what query to run when the user clicks on the widget
- Write Java classes.
class purpose example DataLoader This class generates the queries needed for the statistical analysis. org.intermine.bio.web.widget.PublicationLdr URLQuery (optional) This class generates the queries used to generate results when a user clicks on a specific data point. org.intermine.bio.web.widget.PublicationURLQuery
Back: WorkshopDayTwo
Attachments
- tableWidget.png (16.5 kB) -
screenshot of a table widget from FlyMine
, added by julie on 08/10/08 16:23:58. - enrichmentWidget.png (25.7 kB) -
enrichment widget from FlyMine's list analysis page
, added by julie on 09/10/08 15:12:32. - graphWidget.png (35.1 kB) -
graph widget from FlyMine's list analysis page
, added by julie on 10/10/08 11:12:13.



