Commit 965291c7 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

Merge branch 'feature-c/2703-numeric-axes-clean' into 'dev'

Feature c/2703 numeric axes clean

See merge request !138
parents 8aab651c c566510b
Pipeline #11627 passed with stages
in 17 seconds
......@@ -136,6 +136,15 @@ GenericAxis.prototype = {
}
},
sortValueMapping: function() {
var temp = {}
for (var key_pos in Object.keys(this.value_mapping).sort()){
key = Object.keys(this.value_mapping).sort()[key_pos]
temp[key] = this.value_mapping[key]
}
this.value_mapping = temp
},
applyConverter: function(value) {
var val;
try {
......
......@@ -151,14 +151,16 @@ NumericalAxis.prototype = Object.create(GenericAxis.prototype);
var clone = this.clones[idx];
if(!clone.isVirtual()) {
var value = this.applyConverter(clone);
if (typeof value == "undefined" || typeof this.value_mapping[value] == "undefined") {
if (typeof value == "undefined" || value == undefined || value == "undefined") {
if (this.can_undefined)
this.value_mapping["?"].push(clone);
}else{
this.value_mapping[value] = this.value_mapping[value] || []
this.value_mapping[value].push(clone);
}
}
}
this.sortValueMapping()
}
/**
......@@ -282,26 +284,4 @@ FloatAxis.prototype = Object.create(NumericalAxis.prototype);
return parseFloat(value).toFixed(nice_number_digits(this.max - this.min, 2))
}
FloatAxis.prototype.insert_values = function() {
for(var idx in this.clones) {
var clone = this.clones[idx];
if(!clone.isVirtual()) {
var value = this.applyConverter(clone)//.toFixed(2);
if (typeof value == "undefined" || value == undefined || value == "undefined") {
if (this.can_undefined)
this.value_mapping["?"].push(clone);
}else{
this.value_mapping[value] = this.value_mapping[value] || []
this.value_mapping[value].push(clone);
}
}
}
var temp = {}
var sorted_keys = Object.keys(this.value_mapping).sort()
for (var key_pos in sorted_keys){
key = sorted_keys[key_pos]
temp[key] = this.value_mapping[key]
}
this.value_mapping = temp
}
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