Mercurial > repos > azomics > clustergrammer_flow
comparison js/load_clustergramIPG.js @ 0:fee56ee2f7ac draft
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/clustergrammer_flow commit b11dfcf10d287c1da91ffb1d5d0148c7f8f61356"
| author | azomics |
|---|---|
| date | Fri, 31 Jul 2020 19:06:45 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:fee56ee2f7ac |
|---|---|
| 1 /* | |
| 2 Example files | |
| 3 */ | |
| 4 | |
| 5 //var hzome = ini_hzome(); | |
| 6 | |
| 7 make_clust('mult_view.json'); | |
| 8 | |
| 9 var about_string = 'Zoom, scroll, and click buttons to interact with the clustergram. <a href="http://amp.pharm.mssm.edu/clustergrammer/help"> <i class="fa fa-question-circle" aria-hidden="true"></i> </a>'; | |
| 10 | |
| 11 function make_clust(inst_network){ | |
| 12 | |
| 13 d3.json(inst_network, function(network_data){ | |
| 14 | |
| 15 // define arguments object | |
| 16 var args = { | |
| 17 root: '#container-id-1', | |
| 18 'network_data': network_data, | |
| 19 'about':about_string, | |
| 20 'row_tip_callback':test_row_callback, | |
| 21 'col_tip_callback':test_col_callback, | |
| 22 'tile_tip_callback':test_tile_callback, | |
| 23 'dendro_callback':dendro_callback, | |
| 24 //'matrix_update_callback':matrix_update_callback, | |
| 25 'cat_update_callback': cat_update_callback, | |
| 26 'sidebar_width':150, | |
| 27 'tile_colors':['#FFFB00','#00A2BF'], | |
| 28 'bar_colors':['#FFFB00','#00A2BF'], | |
| 29 'row_label': "Population / Cluster", | |
| 30 'col_label': "" | |
| 31 // 'ini_view':{'N_row_var':20} | |
| 32 // 'ini_expand':true | |
| 33 }; | |
| 34 | |
| 35 resize_container(args); | |
| 36 | |
| 37 d3.select(window).on('resize',function(){ | |
| 38 resize_container(args); | |
| 39 cgm.resize_viz(); | |
| 40 }); | |
| 41 | |
| 42 cgm = Clustergrammer(args); | |
| 43 | |
| 44 //check_setup_enrichr(cgm); | |
| 45 | |
| 46 d3.select(cgm.params.root + ' .wait_message').remove(); | |
| 47 | |
| 48 }); | |
| 49 | |
| 50 } | |
| 51 | |
| 52 /*function matrix_update_callback(){ | |
| 53 | |
| 54 if (genes_were_found[this.root]){ | |
| 55 enr_obj[this.root].clear_enrichr_results(false); | |
| 56 } | |
| 57 } | |
| 58 */ | |
| 59 function cat_update_callback(){ | |
| 60 console.log('callback to run after cats are updated'); | |
| 61 } | |
| 62 | |
| 63 function test_tile_callback(tile_data){ | |
| 64 var row_name = tile_data.row_name; | |
| 65 var col_name = tile_data.col_name; | |
| 66 | |
| 67 } | |
| 68 | |
| 69 function test_col_callback(col_data){ | |
| 70 var col_name = col_data.name; | |
| 71 } | |
| 72 function test_row_callback(col_data){ | |
| 73 var col_name = col_data.name; | |
| 74 } | |
| 75 | |
| 76 function dendro_callback(inst_selection){ | |
| 77 | |
| 78 var inst_rc; | |
| 79 var inst_data = inst_selection.__data__; | |
| 80 | |
| 81 // toggle enrichr export section | |
| 82 if (inst_data.inst_rc === 'row'){ | |
| 83 d3.select('.enrichr_export_section') | |
| 84 .style('display', 'block'); | |
| 85 } else { | |
| 86 d3.select('.enrichr_export_section') | |
| 87 .style('display', 'none'); | |
| 88 } | |
| 89 | |
| 90 } | |
| 91 | |
| 92 function resize_container(args){ | |
| 93 | |
| 94 var screen_width = window.innerWidth; | |
| 95 var screen_height = window.innerHeight - 20; | |
| 96 | |
| 97 d3.select(args.root) | |
| 98 .style('width', screen_width+'px') | |
| 99 .style('height', screen_height+'px'); | |
| 100 } |
