Skip to content

Instantly share code, notes, and snippets.

@joshkh
Created September 29, 2015 12:28
Show Gist options
  • Save joshkh/521d6b0a28933358f9a1 to your computer and use it in GitHub Desktop.
Save joshkh/521d6b0a28933358f9a1 to your computer and use it in GitHub Desktop.
IMJS 3.15.0-beta1 with existing IMTables
var imtables = require('imtables');
var selector = '#some-elem';
var service = {root: 'https://apps.araport.org/thalemine/service/', headers: {'Authorization': 'SomeValue'}};
var query = {
"name": "Gene_Pathway_1",
"title": "Gene --> Pathway",
"comment": "Updated 6/28/2015 by Agnes",
"description": "Enter a list of genes to retrieve associated pathways.",
"from": "Gene",
"select": [
"primaryIdentifier",
"symbol",
"name",
"pathways.identifier",
"pathways.name"
],
"orderBy": [
{
"path": "primaryIdentifier",
"direction": "ASC"
}
],
"where": [
{
"path": "Gene",
"op": "LOOKUP",
"value": "AT1G65480",
"extraValue": "A. thaliana",
"code": "A",
"editable": true,
"switched": "LOCKED",
"switchable": false
}
]
};
imtables.loadTable(
selector, // Can also be an element, or a jQuery object.
{"start":0,"size":25}, // May be null
{service: service, query: query} // May be an imjs.Query
).then(
function (table) { console.log('Table loaded', table); },
function (error) { console.error('Could not load table', error); }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment