Commit ac2e2d6189daaead542333b13f84d63eb3903196

Authored by Furkan
1 parent 7888911c

#11372 - Adding new functions to Histo1D - Done.

generic_data/defaultValuesConfig.json
... ... @@ -264,7 +264,13 @@
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": "kurtosis", "value": "Kurtosis (of a 2nd parameter)" }
268 274 ],
269 275  
270 276 "availableHistogram1DStyles": [
... ...
js/app/models/PlotObjects/PlotHistogram1DSerieObject.js
... ... @@ -20,6 +20,7 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', {
20 20 // {name: 'serie-xaxis-param', type: 'string'},
21 21 // {name: 'serie-resampling-mode', type: 'string'},
22 22 {name: 'histo1d-function', type: 'string'},
  23 + {name: 'histotype-param', type: 'string' },
23 24 {name: 'histo1d-xbinnumber', type: 'int'},
24 25 {name: 'histo1d-style', type: 'string'},
25 26 {name: 'histo1d-color', type: 'string', defaultValue: "none"}
... ... @@ -35,7 +36,7 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', {
35 36 // this.set('serie-xaxis-param', '');
36 37 // this.set('serie-resampling-mode', amdaDefaultValues.plot.serie.resamplingMode);
37 38 this.set('histo1d-function', amdaDefaultValues.plot.histogram1D.histo1DFunction);
38   - // this.set('histotype-param', '');
  39 + this.set('histotype-param', '');
39 40 this.set('histo1d-xbinnumber', amdaDefaultValues.plot.histogram1D.xbinnumber);
40 41 this.set('histo1d-style', amdaDefaultValues.plot.histogram1D.histo1DStyle);
41 42 this.set('histo1d-color', amdaDefaultValues.plot.histogram1D.color);
... ... @@ -49,7 +50,7 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', {
49 50 // serieValues['serie-xaxis-param'] = this.get('serie-xaxis-param');
50 51 // serieValues['serie-resampling-mode'] = this.get('serie-resampling-mode');
51 52 serieValues['histo1d-function'] = this.get('histo1d-function');
52   - // serieValues['histotype-param'] = this.get('histotype-param');
  53 + serieValues['histotype-param'] = this.get('histotype-param');
53 54 serieValues['histo1d-xbinnumber'] = this.get('histo1d-xbinnumber');
54 55 serieValues['histo1d-style'] = this.get('histo1d-style');
55 56 serieValues['histo1d-color'] = this.get('histo1d-color');
... ...
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  
... ... @@ -85,11 +91,13 @@ Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', {
85 91  
86 92 this.addStandardCombo('histo1d-function', 'Function to apply', amdaDefaultConfigs.availableHistogram1DFunctions, function(name, value, oldValue) {
87 93 me.object.set('histo1d-function', value);
  94 + me.updateOptions(value);
88 95 }),
89   - // this.addStandardParamDropTarget('histotype-param', 'Z Parameter', function(name, value, oldValue) {
90   - // me.object.set('histotype-param', value);
91   - // me.crtTree.refresh();
92   - // }),
  96 + this.addStandardParamDropTarget('histotype-param', 'Y Parameter', function(name, value, oldValue) {
  97 + me.object.set('histotype-param', value);
  98 + me.crtTree.refresh();
  99 + }),
  100 +
93 101 this.addStandardInteger('histo1d-xbinnumber', 'Nb. of bins'),
94 102 this.addColorsPicker('histo1d-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'none')
95 103  
... ...