From ac2e2d6189daaead542333b13f84d63eb3903196 Mon Sep 17 00:00:00 2001 From: Furkan Date: Thu, 23 Nov 2023 15:58:28 +0000 Subject: [PATCH] #11372 - Adding new functions to Histo1D - Done. --- generic_data/defaultValuesConfig.json | 8 +++++++- js/app/models/PlotObjects/PlotHistogram1DSerieObject.js | 5 +++-- js/app/views/PlotComponents/PlotHistogram1DSerieForm.js | 16 ++++++++++++---- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/generic_data/defaultValuesConfig.json b/generic_data/defaultValuesConfig.json index eedc6e7..a862878 100644 --- a/generic_data/defaultValuesConfig.json +++ b/generic_data/defaultValuesConfig.json @@ -264,7 +264,13 @@ "availableHistogram1DFunctions": [ { "key": "density", "value": "Density" }, - { "key": "normdensity", "value": "Normalised Density" } + { "key": "normdensity", "value": "Normalised Density" }, + { "key": "mean", "value": "Mean (of a 2nd parameter)" }, + { "key": "min", "value": "Minimum (of a 2nd parameter)" }, + { "key": "max", "value": "Maximum (of a 2nd parameter)" }, + { "key": "median", "value": "Median (of a 2nd parameter)" }, + { "key": "stadev", "value": "Sta. Dev. (of a 2nd parameter)" }, + { "key": "kurtosis", "value": "Kurtosis (of a 2nd parameter)" } ], "availableHistogram1DStyles": [ diff --git a/js/app/models/PlotObjects/PlotHistogram1DSerieObject.js b/js/app/models/PlotObjects/PlotHistogram1DSerieObject.js index b6e1912..4820926 100644 --- a/js/app/models/PlotObjects/PlotHistogram1DSerieObject.js +++ b/js/app/models/PlotObjects/PlotHistogram1DSerieObject.js @@ -20,6 +20,7 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', { // {name: 'serie-xaxis-param', type: 'string'}, // {name: 'serie-resampling-mode', type: 'string'}, {name: 'histo1d-function', type: 'string'}, + {name: 'histotype-param', type: 'string' }, {name: 'histo1d-xbinnumber', type: 'int'}, {name: 'histo1d-style', type: 'string'}, {name: 'histo1d-color', type: 'string', defaultValue: "none"} @@ -35,7 +36,7 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', { // this.set('serie-xaxis-param', ''); // this.set('serie-resampling-mode', amdaDefaultValues.plot.serie.resamplingMode); this.set('histo1d-function', amdaDefaultValues.plot.histogram1D.histo1DFunction); - // this.set('histotype-param', ''); + this.set('histotype-param', ''); this.set('histo1d-xbinnumber', amdaDefaultValues.plot.histogram1D.xbinnumber); this.set('histo1d-style', amdaDefaultValues.plot.histogram1D.histo1DStyle); this.set('histo1d-color', amdaDefaultValues.plot.histogram1D.color); @@ -49,7 +50,7 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', { // serieValues['serie-xaxis-param'] = this.get('serie-xaxis-param'); // serieValues['serie-resampling-mode'] = this.get('serie-resampling-mode'); serieValues['histo1d-function'] = this.get('histo1d-function'); - // serieValues['histotype-param'] = this.get('histotype-param'); + serieValues['histotype-param'] = this.get('histotype-param'); serieValues['histo1d-xbinnumber'] = this.get('histo1d-xbinnumber'); serieValues['histo1d-style'] = this.get('histo1d-style'); serieValues['histo1d-color'] = this.get('histo1d-color'); diff --git a/js/app/views/PlotComponents/PlotHistogram1DSerieForm.js b/js/app/views/PlotComponents/PlotHistogram1DSerieForm.js index 78a79c3..9043f14 100644 --- a/js/app/views/PlotComponents/PlotHistogram1DSerieForm.js +++ b/js/app/views/PlotComponents/PlotHistogram1DSerieForm.js @@ -13,6 +13,7 @@ Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', { setObject: function (object) { this.callParent(arguments); + this.updateOptions(this.object.get('histo1d-function')); }, setParentObject: function (parentObject) { @@ -20,7 +21,12 @@ Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', { this.updateAxesRanges(parentObject); }, + updateOptions: function(functionType) { + var isDensity = (functionType == 'density') || (functionType == 'normdensity'); + var yParamField = this.getForm().findField('histotype-param'); + yParamField.setVisible(!isDensity) + }, updateAxesRanges: function(parentObject) { var xAxisObj = parentObject.axes().getById('xaxis_id'); @@ -85,11 +91,13 @@ Ext.define('amdaPlotComp.PlotHistogram1DSerieForm', { this.addStandardCombo('histo1d-function', 'Function to apply', amdaDefaultConfigs.availableHistogram1DFunctions, function(name, value, oldValue) { me.object.set('histo1d-function', value); + me.updateOptions(value); }), - // this.addStandardParamDropTarget('histotype-param', 'Z Parameter', function(name, value, oldValue) { - // me.object.set('histotype-param', value); - // me.crtTree.refresh(); - // }), + this.addStandardParamDropTarget('histotype-param', 'Y Parameter', function(name, value, oldValue) { + me.object.set('histotype-param', value); + me.crtTree.refresh(); + }), + this.addStandardInteger('histo1d-xbinnumber', 'Nb. of bins'), this.addColorsPicker('histo1d-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'none') -- libgit2 0.21.2