Mercurial > repos > immport-devteam > flow_overview
comparison js/scatterMFI.js @ 1:b5453d07f740 draft default tip
"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/flow_overview commit 65373effef15809f3db0e5f9603ef808f4110aa3"
author | azomics |
---|---|
date | Wed, 29 Jul 2020 17:03:53 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8283ff163ba6 | 1:b5453d07f740 |
---|---|
1 // Copyright (c) 2016 Northrop Grumman. | |
2 // All rights reserved. | |
3 | |
4 var processScatterDataMFI2D = function() { | |
5 var xData = [], | |
6 yData = [], | |
7 popData = [], | |
8 col1 = [], | |
9 col2 = [], | |
10 pop = scatterDataMFI['poplist']; | |
11 | |
12 col1 = scatterDataMFI['data'].map(function(value,index) { | |
13 return value[scatterDataMFI['m1']]; | |
14 }); | |
15 col2 = scatterDataMFI['data'].map(function(value,index) { | |
16 return value[scatterDataMFI['m2']]; | |
17 }); | |
18 for (var i = 0, j=col1.length; i < j; i++) { | |
19 if (scatterDataMFI['selectedPopulations'].indexOf(pop[i]) >= 0) { | |
20 xData.push(col1[i]); | |
21 yData.push(col2[i]); | |
22 popData.push(pop[i]); | |
23 } | |
24 } | |
25 scatterDataMFI['popColors'] = popData.map(function(value,index) { | |
26 return color_palette[0][value][0]; | |
27 }); | |
28 scatterDataMFI['xData'] = xData; | |
29 scatterDataMFI['yData'] = yData; | |
30 scatterDataMFI['popData'] = popData; | |
31 return scatterDataMFI; | |
32 }; | |
33 | |
34 var processScatterData3DMFI = function() { | |
35 var xData = [], | |
36 yData = [], | |
37 zData = [], | |
38 col1 = [], | |
39 col2 = [], | |
40 col3 = [], | |
41 pop = [], | |
42 min = Number.MAX_VALUE, | |
43 max = Number.MIN_VALUE, | |
44 popData = []; | |
45 | |
46 min = d3.min(scatterData3DMFI['data'], function(array) { | |
47 return d3.min(array); | |
48 }); | |
49 max = d3.max(scatterData3DMFI['data'], function(array) { | |
50 return d3.max(array); | |
51 }); | |
52 scatterData3DMFI['min'] = 0; | |
53 scatterData3DMFI['max'] = max; | |
54 | |
55 col1 = scatterData3DMFI['data'].map(function(value,index) { | |
56 return value[scatterData3DMFI['m1']]; | |
57 }); | |
58 col2 = scatterData3DMFI['data'].map(function(value,index) { | |
59 return value[scatterData3DMFI['m2']]; | |
60 }); | |
61 col3 = scatterData3DMFI['data'].map(function(value,index) { | |
62 return value[scatterData3DMFI['m3']]; | |
63 }); | |
64 pop = scatterData3DMFI['poplist']; | |
65 | |
66 for (var i = 0, j = col1.length; i < j; i++) { | |
67 if (scatterData3DMFI['selectedPopulations'].indexOf(pop[i]) >= 0) { | |
68 xData.push(col1[i]); | |
69 yData.push(col2[i]); | |
70 zData.push(col3[i]); | |
71 popData.push(pop[i]); | |
72 } | |
73 } | |
74 | |
75 scatterData3DMFI['popColors'] = popData.map(function(value,index) { | |
76 return color_palette[0][value][0]; | |
77 }); | |
78 scatterData3DMFI['xData'] = xData; | |
79 scatterData3DMFI['yData'] = yData; | |
80 scatterData3DMFI['zData'] = zData; | |
81 scatterData3DMFI['popData'] = popData; | |
82 return scatterData3DMFI; | |
83 }; |