Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
metexplore
MetExploreViz
Commits
ad672a51
Commit
ad672a51
authored
Jul 12, 2021
by
Jean-Clement Gallardo
Browse files
modif findQuantile + bug fix import flux data
parent
057ca51b
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/view/button/buttonImportFlux/ButtonImportFluxController.js
View file @
ad672a51
...
...
@@ -9,13 +9,14 @@ Ext.define('metExploreViz.view.button.buttonImportFlux.ButtonImportFluxControlle
alias
:
'
controller.buttonImportFlux
'
,
init
:
function
()
{
var
me
=
this
,
view
=
me
.
getView
();
var
me
=
this
,
view
=
me
.
getView
();
// Listener which allows opening file manager of client side
view
.
lookupReference
(
'
importFluxHidden
'
).
on
({
change
:
function
(){
change
:
function
(){
metExploreD3
.
GraphUtils
.
handleFileSelect
(
view
.
lookupReference
(
'
importFluxHidden
'
).
fileInputEl
.
dom
,
me
.
loadData
);
view
.
lookupReference
(
'
importFluxHidden
'
).
fileInputEl
.
dom
.
value
=
""
;
},
scope
:
me
});
...
...
@@ -38,6 +39,13 @@ Ext.define('metExploreViz.view.button.buttonImportFlux.ButtonImportFluxControlle
var
targetName
=
firstLine
.
splice
(
0
,
1
);
var
array
=
[];
for
(
var
i
=
0
;
i
<
_metExploreViz
.
flux
.
length
;
i
++
){
if
(
title
===
_metExploreViz
.
flux
[
i
].
name
){
metExploreD3
.
displayWarning
(
"
Loaded file
"
,
"
This file has already been loaded
"
);
return
;
}
}
if
(
targetName
[
0
]
==
"
Identifier
"
||
targetName
[
0
]
==
"
reactionId
"
||
targetName
[
0
]
==
"
Name
"
)
{
var
flux
=
new
Flux
(
title
,
firstLine
,
targetName
[
0
],
array
);
for
(
var
i
=
lines
.
length
-
1
;
i
>=
0
;
i
--
)
{
...
...
resources/lib/functions/GraphFlux.js
View file @
ad672a51
...
...
@@ -319,25 +319,6 @@ metExploreD3.GraphFlux = {
}
},
// Pour value > inter
// 2/(max-inter) === coef multiplicateur
// (value-inter)*coef + 3 === width
// ex : inter = 300, max = 540, value = 400 -> coef = 0,0083 => width = 3,83
// value = 500 -> width = 4,66
// value = 540 -> width = 4,992
// Pour value < inter
// 2/(inter-min) === coef
// 3 - (inter-value)*coef === width
// ex : inter = 300, min = 40, value = 100 -> coef = 0,0077 => width = 1,46
// value = 250 -> width = 2,615
// value = 50 -> width = 1,075
// Pour Proportional
// coef = 4 / (max - min)
// width = 1 + (fluxValue - min) * coef
// exemple : min = 100, max = 460, value = 400 -> coef = 0.011 => width = 4.3
fluxDistribution
:
function
(
fluxValues
){
var
distrib
=
{};
...
...
@@ -362,15 +343,10 @@ metExploreD3.GraphFlux = {
var
sortedValues
=
values
.
slice
().
sort
(
function
(
a
,
b
){
return
a
-
b
;
});
var
pos
=
(
sortedValues
.
length
-
1
)
*
q
;
var
base
=
Math
.
floor
(
pos
);
var
rest
=
pos
-
base
;
if
(
sortedValues
[
base
+
1
]
!==
undefined
){
var
quantile
=
sortedValues
[
base
]
+
rest
*
(
sortedValues
[
base
+
1
]
-
sortedValues
[
base
]);
}
else
{
var
quantile
=
sortedValues
[
base
];
}
var
pos
=
(
sortedValues
.
length
)
*
q
;
var
base
=
Math
.
ceil
(
pos
)
-
1
;
var
quantile
=
sortedValues
[
base
];
var
minValue
=
sortedValues
[
0
];
var
maxValue
=
sortedValues
[
sortedValues
.
length
-
1
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment