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 = {
},
normalizeInfo: function () {
if (this.m.norm){
if (this.m.normalization_mode != this.NORM_FALSE){
var container = this.container("Normalization")
var norm_id = this.m.normalization.id
var norm_value = this.m.normalization.B
......
......@@ -544,15 +544,9 @@ Graph.prototype = {
];
var size = []
if (this.m.norm === true){
for (var j = 0; j < res.length; 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))]);
......@@ -749,7 +743,7 @@ Graph.prototype = {
for (var i = 0; i < this.m.samples.number; i++) {
var t = this.m.samples.order.indexOf(i)
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)
}
......@@ -971,14 +965,12 @@ Graph.prototype = {
var max = this.m.precision*this.m.max_size
//get ready for something really dirty
if (this.m.norm){
for (var i=0; i<this.m.samples.order.length; i++) {
for (var j=0; j<this.m.clones.length; j++){
var size = this.m.precision*this.m.clone(j).getSize()
if (size>max) max=size;
}
}
}
this.scale_x = d3.scale.log()
.domain([1, max])
......@@ -1028,15 +1020,13 @@ Graph.prototype = {
var max = 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)
min = this.m.normalize(min, 0)
}
for (var i = 0; i < this.m.samples.number; i++) {
var t = this.m.samples.order.indexOf(i)
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<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