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 typepurposerequirements
tabledisplays the counts from the list for the collection specifiedupdate config file
graphdisplays a chart based on a dataset you specifyupdate config file, query written in java
enrichmentdisplays the p-values of objects that appear in your listupdate config file, query written in java

Table widgets

Table widgets display objects and the counts of related objects in your list.

screenshot of a table widget from FlyMine

To create a table widget, follow these two steps:

  1. Configure the widget in webconfig-model.xml
attributepurposeexample
idunique id used by javascript onlyunique_id
pathStringswhich collection to use in the widgetGene.proteins
exportFieldwhich field from the objects in your list to exportprimaryIdentifier
typeClasstypes of lists that should display this widgetorg.flymine.model.genomic.Gene

optional attributes

attributepurpose
titleappears at the top of the widget
descriptiondescription of the widget
displayFieldswhich fields from the objects in the collection (in the above example, Gene.proteins) to display, eg. primaryAccession
columnTitleheading for the "count" column
externalLinklink displayed next to first column, identifier will be appended to link
externalLinkLabellabel for external link
linkwhat query to run when the user clicks on the widget (see below)
  1. 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.

graph widget from FlyMine's list analysis page

To create a graph widget, follow these two steps:

  1. Configure the widget in webconfig-model.xml
attributepurposeexample
idunique id used by javascript onlyunique_id
dataSetLoaderJava class that retrieves the data displayed in the chartorg.flymine.web.widget.FlyAtlasDataSetLdr
typeClasstypes of lists that should display this widgetorg.flymine.model.genomic.Gene

optional attributes

attributepurposeexample
titleappears at the top of the widgetChromosome Distribution
descriptiondescription of the widgetActual: number of items in this list found on each chromosome. Expected: given the total number ...
domainLabel Label displayed on x-axisChromosome
rangeLabel Label displayed on y-axisCount
graphType which type of chart to renderBarChart (default) or StackedBarChart
linkwhat query to run when the user clicks on the widgetorg.flymine.web.widget.FlyAtlasGraphURLGenerator
extraAttributeClass currently only used to add organismorg.intermine.bio.web.logic.BioUtil
  1. Write Java classes

classpurposeexample
DataSetLoaderRetrieves the data to be rendered in the chart.org.flymine.web.widget.FlyAtlasDataSetLdr
URLGenerator (optional)Generates the URLs assigned to each bar on the chartorg.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.

enrichment widget from FlyMine's list analysis page

To create an enrichment widget, follow these two steps:

  1. Configure the widget in webconfig-model.xml
attributepurposeexample
idunique id used by javascript onlyunique_id
typeClasstypes of lists that should display this widgetorg.flymine.model.genomic.Gene
dataSetLoaderJava class that retrieves the data displayed in the widgetorg.intermine.bio.web.widget.PublicationLdr

optional attributes

attributepurpose
titleappears at the top of the widget
descriptiondescription of the widget
labelheading for the column
externalLinklink displayed next to first column
externalLinkLabellabel for external link
filtersextra filters to add to the display
filterLabellabel for filter form field
linkwhat query to run when the user clicks on the widget
  1. Write Java classes.
classpurposeexample
DataLoaderThis 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