Commit a79c3235 authored by Thonier Florian's avatar Thonier Florian Committed by Mathieu Giraud

js/export.js, js/graph.js: use refactored m.normalize()

See #3644.
parent 997d754a
...@@ -462,7 +462,7 @@ Report.prototype = { ...@@ -462,7 +462,7 @@ Report.prototype = {
}, },
normalizeInfo: function () { normalizeInfo: function () {
if (this.m.norm){ if (this.m.normalization_mode != this.NORM_FALSE){
var container = this.container("Normalization") var container = this.container("Normalization")
var norm_id = this.m.normalization.id var norm_id = this.m.normalization.id
var norm_value = this.m.normalization.B var norm_value = this.m.normalization.B
......
...@@ -544,14 +544,8 @@ Graph.prototype = { ...@@ -544,14 +544,8 @@ Graph.prototype = {
]; ];
var size = [] var size = []
if (this.m.norm === true){ for (var j = 0; j < res.length; j++) {
for (var j = 0; j < res.length; j++) { size[j] = this.m.normalize(res[j], j)
size[j] = this.m.normalize(res[j], j)
}
}else{
for (var k = 0; k < res.length; k++) {
size[k] = res[k]
}
} }
p.push([0, (1 - this.scale_x(size[0] * this.m.precision))]); p.push([0, (1 - this.scale_x(size[0] * this.m.precision))]);
...@@ -749,7 +743,7 @@ Graph.prototype = { ...@@ -749,7 +743,7 @@ Graph.prototype = {
for (var i = 0; i < this.m.samples.number; i++) { for (var i = 0; i < this.m.samples.number; i++) {
var t = this.m.samples.order.indexOf(i) var t = this.m.samples.order.indexOf(i)
var val = this.m.data[key][t] var val = this.m.data[key][t]
if (this.m.norm && this.m.normalization.type=="data") val = this.m.normalize(val,t) val = this.m.normalize(val,t)
tab.push(val) tab.push(val)
} }
...@@ -971,12 +965,10 @@ Graph.prototype = { ...@@ -971,12 +965,10 @@ Graph.prototype = {
var max = this.m.precision*this.m.max_size var max = this.m.precision*this.m.max_size
//get ready for something really dirty //get ready for something really dirty
if (this.m.norm){ for (var i=0; i<this.m.samples.order.length; i++) {
for (var i=0; i<this.m.samples.order.length; i++) { for (var j=0; j<this.m.clones.length; j++){
for (var j=0; j<this.m.clones.length; j++){ var size = this.m.precision*this.m.clone(j).getSize()
var size = this.m.precision*this.m.clone(j).getSize() if (size>max) max=size;
if (size>max) max=size;
}
} }
} }
...@@ -1028,15 +1020,13 @@ Graph.prototype = { ...@@ -1028,15 +1020,13 @@ Graph.prototype = {
var max = this.m.data[key][0]; var max = this.m.data[key][0];
var min = this.m.data[key][0]; var min = this.m.data[key][0];
if (this.m.norm && this.m.normalization.type=="data"){ max = this.m.normalize(max, 0)
max = this.m.normalize(max, 0) min = this.m.normalize(min, 0)
min = this.m.normalize(min, 0)
}
for (var i = 0; i < this.m.samples.number; i++) { for (var i = 0; i < this.m.samples.number; i++) {
var t = this.m.samples.order.indexOf(i) var t = this.m.samples.order.indexOf(i)
var val = this.m.data[key][t] var val = this.m.data[key][t]
if (this.m.norm && this.m.normalization.type=="data") val = this.m.normalize(val, t) val = this.m.normalize(val, t)
if (val>max) max=val; if (val>max) max=val;
if (val<min) min=val; if (val<min) min=val;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment