Commit c44978ac authored by Mathieu Giraud's avatar Mathieu Giraud

js/scatterPlot.js, js/generic_axis.js: extract barTab computation to GenericAxis

See #2700.
parent 0809fbff
Pipeline #36305 failed with stages
in 5 minutes and 47 seconds
......@@ -242,6 +242,13 @@ GenericAxis.prototype = {
return value;
},
computeBarTab: function(ref) {
ref.barTab = {};
for (var key in this.value_mapping) {
ref.barTab[key] = this.value_mapping[key];
}
},
posBarLabel : function (i) {
var length = Object.keys(this.value_mapping).length;
return (i-0.5)/length ;
......
......@@ -565,10 +565,7 @@ ScatterPlot.prototype = {
//split clones into bar (axisX)
this.axisX.init(this.m.clones, this.available_axis[this.splitX].fct);
this.barTab = {};
for (var key in this.axisX.value_mapping) {
this.barTab[key] = this.axisX.value_mapping[key];
}
this.axisX.computeBarTab(this)
//sort each bar (axisY)
......
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