Mercurial > repos > iuc > jbrowse
comparison test-data/index.html @ 3:7342f467507b draft
Uploaded v0.4 of JBrowse
author | iuc |
---|---|
date | Thu, 31 Dec 2015 13:58:43 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2:b6a0e126dbee | 3:7342f467507b |
---|---|
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
5 <title>JBrowse</title> | |
6 <link rel="stylesheet" type="text/css" href="css/genome.css"> | |
7 </head> | |
8 <body> | |
9 | |
10 <script type="text/javascript"> | |
11 // jshint unused: false | |
12 var dojoConfig = { | |
13 async: true, | |
14 baseUrl: './src', | |
15 has: { | |
16 'host-node': false // Prevent dojo from being fooled by Electron | |
17 } | |
18 }; | |
19 // Move Electron's require out before loading Dojo | |
20 if(window.process&&process.versions&&process.versions.electron) { | |
21 window.electronRequire = require; | |
22 delete window.require; | |
23 } | |
24 </script> | |
25 <script type="text/javascript" src="src/dojo/dojo.js"></script> | |
26 <script type="text/javascript" src="src/JBrowse/init.js"></script> | |
27 <script type="text/javascript"> | |
28 window.onerror=function(msg){ | |
29 if( document.body ) | |
30 document.body.setAttribute("JSError",msg); | |
31 } | |
32 | |
33 // puts the main Browser object in this for convenience. feel | |
34 // free to move it into function scope if you want to keep it | |
35 // out of the global namespace | |
36 var JBrowse; | |
37 require(['JBrowse/Browser', 'dojo/io-query', 'dojo/json' ], | |
38 function (Browser,ioQuery,JSON) { | |
39 // the initial configuration of this JBrowse | |
40 // instance | |
41 | |
42 // NOTE: this initial config is the same as any | |
43 // other JBrowse config in any other file. this | |
44 // one just sets defaults from URL query params. | |
45 // If you are embedding JBrowse in some other app, | |
46 // you might as well just set this initial config | |
47 // to something like { include: '../my/dynamic/conf.json' }, | |
48 // or you could put the entire | |
49 // dynamically-generated JBrowse config here. | |
50 | |
51 // parse the query vars in the page URL | |
52 var queryParams = ioQuery.queryToObject( window.location.search.slice(1) ); | |
53 | |
54 var config = { | |
55 containerID: "GenomeBrowser", | |
56 | |
57 dataRoot: queryParams.data, | |
58 queryParams: queryParams, | |
59 location: queryParams.loc, | |
60 forceTracks: queryParams.tracks, | |
61 initialHighlight: queryParams.highlight, | |
62 show_nav: queryParams.nav, | |
63 show_tracklist: queryParams.tracklist, | |
64 show_overview: queryParams.overview, | |
65 show_menu: queryParams.menu, | |
66 show_tracklabels: queryParams.tracklabels, | |
67 highResolutionMode: queryParams.highres, | |
68 stores: { url: { type: "JBrowse/Store/SeqFeature/FromConfig", features: [] } }, | |
69 makeFullViewURL: function( browser ) { | |
70 | |
71 // the URL for the 'Full view' link | |
72 // in embedded mode should be the current | |
73 // view URL, except with 'nav', 'tracklist', | |
74 // and 'overview' parameters forced to 1. | |
75 | |
76 return browser.makeCurrentViewURL({ nav: 1, tracklist: 1, overview: 1 }); | |
77 }, | |
78 updateBrowserURL: true | |
79 }; | |
80 | |
81 //if there is ?addFeatures in the query params, | |
82 //define a store for data from the URL | |
83 if( queryParams.addFeatures ) { | |
84 config.stores.url.features = JSON.parse( queryParams.addFeatures ); | |
85 } | |
86 | |
87 // if there is ?addTracks in the query params, add | |
88 // those track configurations to our initial | |
89 // configuration | |
90 if( queryParams.addTracks ) { | |
91 config.tracks = JSON.parse( queryParams.addTracks ); | |
92 } | |
93 | |
94 // if there is ?addStores in the query params, add | |
95 // those store configurations to our initial | |
96 // configuration | |
97 if( queryParams.addStores ) { | |
98 config.stores = JSON.parse( queryParams.addStores ); | |
99 } | |
100 | |
101 // create a JBrowse global variable holding the JBrowse instance | |
102 JBrowse = new Browser( config ); | |
103 }); | |
104 </script> | |
105 | |
106 </head> | |
107 | |
108 <body> | |
109 <div id="GenomeBrowser" style="height: 100%; width: 100%; padding: 0; border: 0;"></div> | |
110 <div style="display: none">JBrowseDefaultMainPage</div> | |
111 </body> | |
112 </html> |