annotate js/pCoordCSstats.js @ 2:a64ece32a01a draft default tip

"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
author azomics
date Tue, 28 Jul 2020 08:32:36 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
1 // Copyright (c) 2016 Northrop Grumman.
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
2 // All rights reserved.
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
3
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
4 /*
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
5 * Initialize variables for parallelCoordinates display
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
6 */
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
7 var pcApp = pcApp || {};
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
8
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
9 pcApp.allSamples = [];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
10 pcApp.selectedSamples = [];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
11 pcApp.origData;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
12 pcApp.flowData;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
13 pcApp.updatedData;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
14 pcApp.headers = [];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
15 pcApp.foreground;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
16 pcApp.background;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
17
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
18 var displayAll = function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
19 displayParallelPlot();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
20 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
21 /*
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
22 * Display the Population Legend
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
23 */
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
24 var displaySmpTable = function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
25 $('#popTablePC tbody').empty();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
26 pcApp.origData.map(function(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
27 $('#popTablePC tbody').append('<tr><td align="center">'
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
28 + '<input type="checkbox" id="' + d.SampleName + '" '
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
29 + 'checked class="popSelectPC" value='
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
30 + d.SampleNumber + '/></td><td title="' + newSmpNames[d.SampleName]
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
31 + '">' + newSmpNames[d.SampleName]
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
32 + '</td><td><span style="background-color:'
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
33 + color_palette[0][d.SampleNumber + 1][0]
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
34 + '">&nbsp;&nbsp;&nbsp;</span></td></tr>');
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
35 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
36
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
37 $('#popSelectAllPC').click(function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
38 var checkAll = $("#popSelectAllPC").prop('checked');
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
39 if (checkAll) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
40 $(".popSelectPC").prop("checked", true);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
41 } else {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
42 $(".popSelectPC").prop("checked", false);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
43 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
44 pcApp.selectedSamples = [];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
45 $('.popSelectPC').each(function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
46 if (this.checked) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
47 pcApp.selectedSamples.push(parseInt(this.value));
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
48 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
49 })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
50 displayTableGrid();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
51 if (checkAll) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
52 displayParallelPlot();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
53 } else {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
54 updateParallelForeground();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
55 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
56 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
57
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
58 $('.popSelectPC').click(function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
59 if ($('.popSelectPC').length == $(".popSelectPC:checked").length) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
60 $('#popSelectAllPC').prop("checked",true);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
61 } else {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
62 $('#popSelectAllPC').prop("checked",false);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
63 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
64 pcApp.selectedSamples = [];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
65 $('.popSelectPC').each(function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
66 if (this.checked) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
67 pcApp.selectedSamples.push(parseInt(this.value));
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
68 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
69 })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
70 displayTableGrid();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
71 updateParallelForeground();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
72 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
73 updateSmpTable();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
74 };
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
75
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
76 var updateSmpTable = function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
77 $('.popSelectPC').each(function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
78 var smp = parseInt(this.value);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
79 if ($.inArray(smp,pcApp.selectedSamples) > -1) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
80 this.checked = true;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
81 } else {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
82 this.checked = false;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
83 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
84 })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
85 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
86
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
87 var displayTableGrid = function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
88 var colTable = [],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
89 colNames = [],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
90 pctargets = [],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
91 updatedHeaders = [],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
92 displayData = [],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
93 targetCol = 0,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
94 textCol = [],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
95 colOrder = [],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
96 tableHTML = [];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
97
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
98 $("#tableDivPC").empty();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
99 pcApp.updatedData = $.extend(true,[],pctablecontent);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
100 pcApp.updatedData.forEach(function(d, idx){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
101 d.SampleName = idx + 1;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
102 delete(d.FileID);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
103 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
104
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
105 updatedHeaders = Object.keys(pcApp.updatedData[0]);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
106 displayData = pcApp.updatedData.filter(function(d,i) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
107 if ($.inArray(i,pcApp.selectedSamples) > -1) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
108 return d;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
109 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
110 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
111
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
112 targetCol = updatedHeaders.length - 2;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
113 updatedHeaders.forEach(function(d,i){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
114 colTable.push("<th>" + d + "</th>");
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
115 colNames.push({"data":d});
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
116 if (i < targetCol){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
117 pctargets.push(i);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
118 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
119 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
120 textCol = [targetCol, targetCol + 1];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
121 colOrder = textCol.concat(pctargets);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
122 tableHTML = [
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
123 '<table id="pcTable" class="pctable display compact nowrap" cellspacing="0" width="100%">',
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
124 '<thead>',
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
125 '<tr>',
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
126 colTable.join("\n"),
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
127 '</tr>',
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
128 '</thead>',
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
129 '</table>',
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
130 ];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
131
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
132 $('#tableDivPC').html(tableHTML.join("\n"));
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
133 var pcTable = $('#pcTable').DataTable({
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
134 columns: colNames,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
135 data: displayData,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
136 order: [[ targetCol, "asc" ]],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
137 pageLength: 10,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
138 //paging: false,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
139 scrollY: 250,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
140 scrollCollapse: true,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
141 scrollX: true,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
142 dom: '<"top"B>t<"bottom"lip><"clear">',
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
143 columnDefs: [{
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
144 targets: pctargets,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
145 className: "dt-body-right",
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
146 render: function(data,type,row){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
147 return parseFloat(data).toFixed(2) + '%';
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
148 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
149 }, {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
150 targets: [targetCol, targetCol+1],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
151 className: "dt-body-center"
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
152 }, {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
153 targets:[targetCol],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
154 render: function(data, type, row){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
155 return 'Sample' + parseInt(data);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
156 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
157 }],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
158 buttons: [
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
159 'copy', 'pdfHtml5','csvHtml5', 'colvis'
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
160 ],
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
161 colReorder: {order:colOrder},
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
162 select: true
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
163 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
164
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
165 $('#pcTable').on('mouseover', 'tr', function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
166 var data = pcTable.row(this).data();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
167 if (data != undefined) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
168 var smp = parseInt(data.SampleName) - 1;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
169 pcApp.selectedSamples = [smp];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
170 updateParallelForeground();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
171 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
172 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
173 $('#pcTable').on('mouseleave', 'tr', function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
174 pcApp.selectedSamples = [];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
175 $('.popSelectPC').each(function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
176 if (this.checked) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
177 pcApp.selectedSamples.push(parseInt(this.value));
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
178 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
179 updateParallelForeground();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
180 })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
181 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
182 };
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
183 /*
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
184 * Display The Main Plot
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
185 */
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
186 var displayParallelPlot = function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
187 var margin = {top: 30, right: 10, bottom: 10, left: 10},
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
188 h = 300,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
189 w = $("#plotDivPC").width(),
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
190 width = w - margin.left - margin.right,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
191 height = h - margin.top - margin.bottom,
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
192 y = {},
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
193 dragging = {},
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
194 ymax = 0;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
195
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
196 $("#plotDivPC").empty();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
197 $("#plotDivPC").height(h);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
198 var svg = d3.select("#plotDivPC").append("svg")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
199 .attr("width", width + margin.left + margin.right)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
200 .attr("height", height + margin.top + margin.bottom)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
201 .append("g")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
202 .attr("transform", "translate(" + margin.left + "," + margin.top + ")")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
203
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
204 var x = d3.scale.ordinal().rangePoints([0, width], 1);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
205 var line = d3.svg.line();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
206 var axis = d3.svg.axis()
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
207 .orient("left")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
208 .tickFormat(d3.format("d"))
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
209 .ticks(5);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
210
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
211 for (var m = 0, n = pcApp.flowData.length; m < n; m++){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
212 for (var p in pcApp.flowData[m]){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
213 if (+pcApp.flowData[m][p] > ymax){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
214 ymax = +pcApp.flowData[m][p];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
215 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
216 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
217 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
218
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
219 // Y axis label
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
220 svg.append("text")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
221 .attr("class", "ylabel")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
222 .attr("transform", "rotate(-90)")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
223 .attr("y", 0 - margin.left)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
224 .attr("x",0 - (height / 2))
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
225 .attr("dy", "1em")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
226 .style("text-anchor", "middle")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
227 .text("Fraction of population in sample");
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
228
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
229 var dimensions = d3.keys(pcApp.flowData[0]).filter(function(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
230 return (y[d] = d3.scale.linear()
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
231 .domain([0,parseInt(ymax)+1])
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
232 .range([height, 0]));
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
233 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
234 x.domain(dimensions);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
235
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
236 function path(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
237 return line(dimensions.map(function(p) { return [x(p), y[p](d[p])]; }));
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
238 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
239
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
240 function position(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
241 var v = dragging[d];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
242 return v == null ? x(d) : v;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
243 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
244
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
245 function transition(g) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
246 return g.transition().duration(500);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
247 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
248
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
249 function brush() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
250 var actives = dimensions.filter(function(p) { return !y[p].brush.empty(); });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
251 var extents = actives.map(function(p) { return y[p].brush.extent(); });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
252 var selectedSamples = pcApp.origData.filter(function(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
253 var smp = parseInt(d.SampleNumber);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
254 var tf = actives.every(function(p,i) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
255 return extents[i][0] <= pcApp.flowData[smp][p] &&
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
256 pcApp.flowData[smp][p] <= extents[i][1];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
257 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
258 if (tf) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
259 return smp.toString();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
260 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
261 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
262 pcApp.selectedSamples = selectedSamples.map(function(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
263 return parseInt(d.SampleNumber);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
264 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
265
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
266 updateParallelForeground();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
267 updateSmpTable()
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
268 displayTableGrid();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
269 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
270 // Display paths in light gray color, to use as reference
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
271 pcApp.background = svg.append("g")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
272 .attr("class", "background")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
273 .selectAll("path")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
274 .data(pcApp.flowData)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
275 .enter().append("path")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
276 .attr("d", path);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
277
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
278 // Add foreground lines for focus, color by population.
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
279 pcApp.foreground = svg.append("g")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
280 .attr("class", "foreground")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
281 .selectAll("path")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
282 .data(pcApp.origData)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
283 .enter().append("path")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
284 .attr("d", function(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
285 var smp = d.SampleNumber;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
286 return path(pcApp.flowData[smp]); })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
287 .attr("stroke",function(d){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
288 var smp = d.SampleNumber + 1;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
289 return color_palette[0][smp][0];})
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
290 .attr("stroke-width", 1);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
291
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
292 // Add a group element for each dimension.
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
293 var g = svg.selectAll(".dimension")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
294 .data(dimensions)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
295 .enter().append("g")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
296 .attr("class", "dimension")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
297 .attr("transform", function(d) { return "translate(" + x(d) + ")"; })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
298 .call(d3.behavior.drag()
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
299 .origin(function(d) { return {x: x(d)}; })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
300 .on("dragstart", function(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
301 dragging[d] = x(d);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
302 pcApp.background.attr("visibility", "hidden");})
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
303 .on("drag", function(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
304 dragging[d] = Math.min(width, Math.max(0, d3.event.x));
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
305 pcApp.foreground.attr("d", path);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
306 dimensions.sort(function(a, b) { return position(a) - position(b); });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
307 x.domain(dimensions);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
308 g.attr("transform", function(d) { return "translate(" + position(d) + ")"; }); })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
309 .on("dragend", function(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
310 delete dragging[d];
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
311 transition(d3.select(this)).attr("transform", "translate(" + x(d) + ")");
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
312 transition(pcApp.foreground).attr("d", path);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
313 pcApp.background
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
314 .attr("d", path)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
315 .transition()
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
316 .delay(500)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
317 .duration(0)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
318 .attr("visibility", null);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
319 }));
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
320
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
321 // Add an axis and title.
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
322 g.append("g")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
323 .attr("class", "axis")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
324 .each(function(d) { d3.select(this).call(axis.scale(y[d])); });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
325 g.append("g")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
326 .attr("class", "xlabel")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
327 .append("text")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
328 .style("text-anchor", "middle")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
329 .attr("y", -9)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
330 .text(function(d) { return d; });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
331
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
332 // Add and store a brush for each axis.
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
333 g.append("g")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
334 .attr("class", "brush")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
335 .each(function(d) { d3.select(this).call(y[d].brush = d3.svg.brush().y(y[d]).on("brush", brush)); })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
336 .selectAll("rect")
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
337 .attr("x", -8)
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
338 .attr("width", 16);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
339
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
340 // Control line opacity.
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
341 $('#PCline_opacity').on('change', (function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
342 var val = $(this).val();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
343 $('#plotDivPC .foreground path').css('stroke-opacity', val.toString());
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
344 $('#pc_opacity').html((Math.round(val*10000)/100) + "%");
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
345 }));
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
346 };
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
347
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
348 var updateParallelForeground = function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
349 pcApp.foreground[0].map(function(d) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
350 var smp = parseInt(d['__data__']['SampleNumber'])
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
351 if ($.inArray(smp,pcApp.selectedSamples) < 0) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
352 d.style.display = "none";
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
353 } else {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
354 d.style.display = null;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
355 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
356 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
357 };
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
358 /*
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
359 * Retrieve the data, then call display functions
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
360 */
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
361 var displayParallelCoordinates = function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
362 /* var inputFile = "./csOverview.tsv";
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
363 d3.tsv(inputFile, function(error, data) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
364 if (error) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
365 alert("Problem Retrieving Data");
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
366 return;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
367 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
368 */
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
369 pcApp.origData = $.extend(true,[], pctablecontent);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
370 pcApp.headers = Object.keys(pcApp.origData[0]);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
371 pcApp.headers.splice(pcApp.headers.indexOf("FileID"), 1);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
372 pcApp.origData.forEach(function(d,idx){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
373 d.SampleNumber = idx;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
374 // delete d.FileID;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
375 })
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
376 /*
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
377 * For the plot use only the proportion of each
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
378 * population per sample. Store in flowData
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
379 */
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
380 pcApp.flowData = $.extend(true,[],pctablecontent);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
381 pcApp.flowData.forEach(function(d,idx){
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
382 delete d.SampleName;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
383 delete d.FileID;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
384 delete d.Comment;
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
385 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
386 for (var i = 0, j = pcApp.flowData.length; i < j ; i++) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
387 pcApp.allSamples.push(i);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
388 pcApp.selectedSamples.push(i);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
389 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
390 displaySmpTable();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
391 displayTableGrid();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
392 displayParallelPlot();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
393
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
394 $("#resetPCDisplay").on("click",function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
395 var opcty = ".8";
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
396 for (var i = 0, j = pcApp.flowData.length; i < j; i++) {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
397 pcApp.allSamples.push(i);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
398 pcApp.selectedSamples.push(i);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
399 }
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
400 $("#smpSelectAllPC").prop('checked',true);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
401 $(".smpSelectPC").prop("checked",true);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
402
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
403 $('#plotDivPC .foreground path').css('stroke-opacity', opcty);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
404 $('#pc_opacity').html("80%");
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
405 $('#PCline_opacity').val(0.8);
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
406
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
407 displaySmpTable();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
408 displayTableGrid();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
409 displayParallelPlot();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
410 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
411
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
412 $(window).on('resize',function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
413 waitForFinalEvent(function() {
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
414 displayAll();
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
415 }, 500, "resizePC");
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
416 });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
417 // });
a64ece32a01a "planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/cs_overview commit a46097db0b6056e1125237393eb6974cfd51eb41"
azomics
parents:
diff changeset
418 };