Commit 8da1cb7687d915446ec068afadebec0179986647

Authored by Benjamin Renard
2 parents c1d7bcd8 3e01c3cc

Merge branch 'Histo1D2D' into amdadev

generic_data/defaultValues.json
... ... @@ -129,12 +129,14 @@
129 129 },
130 130 "histogram2D":{
131 131 "histo2DFunction":"density",
  132 + "histo2DyAxis":"y-left",
132 133 "xbinnumber":100,
133 134 "ybinnumber":100,
134 135 "smoothfactor":1
135 136 },
136 137 "histogram1D":{
137 138 "histo1DFunction":"density",
  139 + "histo1DyAxis":"y-left",
138 140 "xbinnumber":100,
139 141 "histo1DStyle":"bar",
140 142 "color":"#FF0000"
... ...
generic_data/defaultValuesConfig.json
... ... @@ -264,7 +264,14 @@
264 264  
265 265 "availableHistogram1DFunctions": [
266 266 { "key": "density", "value": "Density" },
267   - { "key": "normdensity", "value": "Normalised Density" }
  267 + { "key": "normdensity", "value": "Normalised Density" },
  268 + { "key": "mean", "value": "Mean (of a 2nd parameter)" },
  269 + { "key": "min", "value": "Minimum (of a 2nd parameter)" },
  270 + { "key": "max", "value": "Maximum (of a 2nd parameter)" },
  271 + { "key": "median", "value": "Median (of a 2nd parameter)" },
  272 + { "key": "stadev", "value": "Sta. Dev. (of a 2nd parameter)" },
  273 + { "key": "skewness", "value": "Skewness (of a 2nd parameter)" },
  274 + { "key": "kurtosis", "value": "Kurtosis (of a 2nd parameter)" }
268 275 ],
269 276  
270 277 "availableHistogram1DStyles": [
... ...
generic_data/defaultValuesLinks.json
... ... @@ -231,6 +231,11 @@
231 231 "type":"combobox",
232 232 "store":"availableHistogram2DFunctions"
233 233 },
  234 + "plot.histogram2D.histo2DyAxis":
  235 + {
  236 + "type":"combobox",
  237 + "store":"availableYAxes"
  238 + },
234 239 "plot.histogram1D.histo1DFunction":
235 240 {
236 241 "type":"combobox",
... ... @@ -240,6 +245,11 @@
240 245 {
241 246 "type":"combobox",
242 247 "store":"availableHistogram1DStyles"
  248 + },
  249 + "plot.histogram1D.histo1DyAxis":
  250 + {
  251 + "type":"combobox",
  252 + "store":"availableYAxes"
243 253 },
244 254 "plot.sauvaud.yAxis":
245 255 {
... ...
js/app/models/PlotObjects/PlotHistogram1DSerieObject.js
... ... @@ -19,7 +19,9 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', {
19 19 fields : [
20 20 // {name: 'serie-xaxis-param', type: 'string'},
21 21 // {name: 'serie-resampling-mode', type: 'string'},
  22 + {name: 'histo1d-yaxis', type: 'string'},
22 23 {name: 'histo1d-function', type: 'string'},
  24 + {name: 'histotype-param', type: 'string' },
23 25 {name: 'histo1d-xbinnumber', type: 'int'},
24 26 {name: 'histo1d-style', type: 'string'},
25 27 {name: 'histo1d-color', type: 'string', defaultValue: "none"}
... ... @@ -34,8 +36,9 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', {
34 36 {
35 37 // this.set('serie-xaxis-param', '');
36 38 // this.set('serie-resampling-mode', amdaDefaultValues.plot.serie.resamplingMode);
  39 + this.set('histo1d-yaxis', amdaDefaultValues.plot.histogram1D.histo1DyAxis);
37 40 this.set('histo1d-function', amdaDefaultValues.plot.histogram1D.histo1DFunction);
38   - // this.set('histotype-param', '');
  41 + this.set('histotype-param', '');
39 42 this.set('histo1d-xbinnumber', amdaDefaultValues.plot.histogram1D.xbinnumber);
40 43 this.set('histo1d-style', amdaDefaultValues.plot.histogram1D.histo1DStyle);
41 44 this.set('histo1d-color', amdaDefaultValues.plot.histogram1D.color);
... ... @@ -48,8 +51,9 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', {
48 51 var serieValues = this.callParent(arguments);
49 52 // serieValues['serie-xaxis-param'] = this.get('serie-xaxis-param');
50 53 // serieValues['serie-resampling-mode'] = this.get('serie-resampling-mode');
  54 + serieValues['histo1d-yaxis'] = this.get('histo1d-yaxis');
51 55 serieValues['histo1d-function'] = this.get('histo1d-function');
52   - // serieValues['histotype-param'] = this.get('histotype-param');
  56 + serieValues['histotype-param'] = this.get('histotype-param');
53 57 serieValues['histo1d-xbinnumber'] = this.get('histo1d-xbinnumber');
54 58 serieValues['histo1d-style'] = this.get('histo1d-style');
55 59 serieValues['histo1d-color'] = this.get('histo1d-color');
... ...
js/app/models/PlotObjects/PlotHistogram2DSerieObject.js
... ... @@ -19,6 +19,7 @@ Ext.define('amdaPlotObj.PlotHistogram2DSerieObject', {
19 19 fields : [
20 20 {name: 'serie-xaxis-param', type: 'string'},
21 21 {name: 'serie-resampling-mode', type: 'string'},
  22 + {name: 'histo2d-yaxis', type: 'string'},
22 23 {name: 'histo2d-function', type: 'string'},
23 24 {name: 'histotype-param', type: 'string' },
24 25 {name: 'histo2d-xbinnumber', type: 'int'},
... ... @@ -36,6 +37,7 @@ Ext.define('amdaPlotObj.PlotHistogram2DSerieObject', {
36 37 {
37 38 this.set('serie-xaxis-param', '');
38 39 this.set('serie-resampling-mode', amdaDefaultValues.plot.serie.resamplingMode);
  40 + this.set('histo2d-yaxis', amdaDefaultValues.plot.histogram2D.histo2DyAxis);
39 41 this.set('histo2d-function', amdaDefaultValues.plot.histogram2D.histo2DFunction);
40 42 this.set('histotype-param', '');
41 43 this.set('histo2d-xbinnumber', amdaDefaultValues.plot.histogram2D.xbinnumber);
... ... @@ -50,6 +52,7 @@ Ext.define('amdaPlotObj.PlotHistogram2DSerieObject', {
50 52 var serieValues = this.callParent(arguments);
51 53 serieValues['serie-xaxis-param'] = this.get('serie-xaxis-param');
52 54 serieValues['serie-resampling-mode'] = this.get('serie-resampling-mode');
  55 + serieValues['histo2d-yaxis'] = this.get('histo2d-yaxis');
53 56 serieValues['histo2d-function'] = this.get('histo2d-function');
54 57 serieValues['histotype-param'] = this.get('histotype-param');
55 58 serieValues['histo2d-xbinnumber'] = this.get('histo2d-xbinnumber');
... ...
js/app/views/PlotComponents/PlotHistogram1DSerieForm.js
... ... @@ -13,6 +13,7 @@ Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', {
13 13  
14 14 setObject: function (object) {
15 15 this.callParent(arguments);
  16 + this.updateOptions(this.object.get('histo1d-function'));
16 17 },
17 18  
18 19 setParentObject: function (parentObject) {
... ... @@ -20,7 +21,12 @@ Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', {
20 21 this.updateAxesRanges(parentObject);
21 22  
22 23 },
  24 + updateOptions: function(functionType) {
  25 + var isDensity = (functionType == 'density') || (functionType == 'normdensity');
23 26  
  27 + var yParamField = this.getForm().findField('histotype-param');
  28 + yParamField.setVisible(!isDensity)
  29 + },
24 30 updateAxesRanges: function(parentObject) {
25 31 var xAxisObj = parentObject.axes().getById('xaxis_id');
26 32  
... ... @@ -52,7 +58,8 @@ Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', {
52 58 frame: true,
53 59 //bodyPadding: '5 5 5 5',
54 60 items:
55   - [{
  61 + [
  62 + {
56 63 items:[
57 64 me.addStandardFloat2('histo1d-xmin', 'X Min', -Number.MAX_VALUE, Number.MAX_VALUE, false, false, function(name, newValue, oldValue){
58 65 me.parentObject.axes().getById('xaxis_id').set('axis-range-min', newValue);
... ... @@ -73,6 +80,12 @@ Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', {
73 80 var me = this;
74 81  
75 82 var histogram1DItems = [
  83 +
  84 + this.addStandardCombo('histo1d-yaxis', 'Y axis', amdaDefaultConfigs.availableYAxes, function (name, value, oldValue) {
  85 + me.object.set('histo1d-yaxis', value);
  86 + me.crtTree.refresh();
  87 + }),
  88 +
76 89 this.addStandardCombo('histo1d-style', 'Drawing Style', amdaDefaultConfigs.availableHistogram1DStyles, function(name, value, oldValue) {
77 90 me.object.set('histo1d-style', value);
78 91 }),
... ... @@ -85,11 +98,13 @@ Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', {
85 98  
86 99 this.addStandardCombo('histo1d-function', 'Function to apply', amdaDefaultConfigs.availableHistogram1DFunctions, function(name, value, oldValue) {
87 100 me.object.set('histo1d-function', value);
  101 + me.updateOptions(value);
88 102 }),
89   - // this.addStandardParamDropTarget('histotype-param', 'Z Parameter', function(name, value, oldValue) {
90   - // me.object.set('histotype-param', value);
91   - // me.crtTree.refresh();
92   - // }),
  103 + this.addStandardParamDropTarget('histotype-param', 'Y Parameter', function(name, value, oldValue) {
  104 + me.object.set('histotype-param', value);
  105 + me.crtTree.refresh();
  106 + }),
  107 +
93 108 this.addStandardInteger('histo1d-xbinnumber', 'Nb. of bins'),
94 109 this.addColorsPicker('histo1d-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'none')
95 110  
... ...
js/app/views/PlotComponents/PlotHistogram2DSerieForm.js
... ... @@ -95,6 +95,31 @@ Ext.define('amdaPlotComp.PlotHistogram2DSerieForm', {
95 95 me.object.set('serie-xaxis-param', value);
96 96 me.crtTree.refresh();
97 97 }),
  98 +
  99 + this.addStandardCombo('histo2d-yaxis', 'Y axis', amdaDefaultConfigs.availableYAxes, function (name, value, oldValue) {
  100 + me.object.set('histo2d-yaxis', value);
  101 + var yMinForm = me.getForm().findField('histo2d-ymin');
  102 + var yMaxForm = me.getForm().findField('histo2d-ymax');
  103 + yMaxForm.on('change', function(name, newValue, oldValue){
  104 + me.parentObject.axes().getById(value).set('axis-range-max', newValue);
  105 + if(value === 'y-left')
  106 + me.parentObject.axes().getById('y-right').set('axis-range-max','');
  107 + else if (value === 'y-right')
  108 + me.parentObject.axes().getById('y-left').set('axis-range-max','');
  109 + });
  110 + yMinForm.on('change', function(name, newValue, oldValue){
  111 + me.parentObject.axes().getById(value).set('axis-range-min', newValue);
  112 + if(value === 'y-left')
  113 + me.parentObject.axes().getById('y-right').set('axis-range-min','');
  114 + else if (value === 'y-right')
  115 + me.parentObject.axes().getById('y-left').set('axis-range-min','');
  116 + });
  117 + if(me.parentObject){
  118 + yMinForm.fireEvent('change', yMinForm, yMinForm.getValue(), yMinForm.getValue());
  119 + yMaxForm.fireEvent('change', yMaxForm, yMaxForm.getValue(), yMaxForm.getValue());
  120 + }
  121 + me.crtTree.refresh();
  122 + }),
98 123 me.getRangeForms(),
99 124 this.addStandardCombo('serie-resampling-mode', 'Reference parameter for resampling', amdaDefaultConfigs.availableResamplingModes),
100 125 this.addStandardCombo('histo2d-function', 'Function to apply', amdaDefaultConfigs.availableHistogram2DFunctions, function(name, value, oldValue) {
... ...