From 0ceb8de80026201c863a17cd82609a9629419e68 Mon Sep 17 00:00:00 2001
From: Benjamin Renard <benjamin.renard@akka.eu>
Date: Thu, 30 Mar 2023 11:54:28 +0000
Subject: [PATCH] Add symbolic link to color map definition into histo2D form

---
 js/app/views/PlotComponents/PlotHistogram2DSerieForm.js | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/js/app/views/PlotComponents/PlotHistogram2DSerieForm.js b/js/app/views/PlotComponents/PlotHistogram2DSerieForm.js
index 2c1a084..3f9e273 100644
--- a/js/app/views/PlotComponents/PlotHistogram2DSerieForm.js
+++ b/js/app/views/PlotComponents/PlotHistogram2DSerieForm.js
@@ -18,7 +18,7 @@ Ext.define('amdaPlotComp.PlotHistogram2DSerieForm', {
 
 	setParentObject: function (parentObject) {
 		this.callParent(arguments);
-		this.updateAxesRanges(parentObject);
+		this.updateAxesRangesAndColourMap(parentObject);
 	},
 
 	updateOptions: function(functionType) {
@@ -28,13 +28,16 @@ Ext.define('amdaPlotComp.PlotHistogram2DSerieForm', {
 		zParamField.setVisible(!isDensity)
 	},
 
-	updateAxesRanges: function(parentObject) {
+	updateAxesRangesAndColourMap: function(parentObject) {
 		var xAxisObj = parentObject.axes().getById('xaxis_id');
 		var yAxisObj = parentObject.axes().getById('y-left');
+		var colorAxisObj = parentObject.axes().getById('color');
+		
 		this.getForm().findField('histo2d-xmin').setValue(xAxisObj.get('axis-range-min'));
 		this.getForm().findField('histo2d-xmax').setValue(xAxisObj.get('axis-range-max'));
 		this.getForm().findField('histo2d-ymin').setValue(yAxisObj.get('axis-range-min'));
 		this.getForm().findField('histo2d-ymax').setValue(yAxisObj.get('axis-range-max'));
+		this.getForm().findField('histo2d-color-map').setValue(colorAxisObj.get('axis-color-map'));
 	},
 
 	getRangeForms: function(){
@@ -104,7 +107,10 @@ Ext.define('amdaPlotComp.PlotHistogram2DSerieForm', {
 			}),
 			this.addStandardInteger('histo2d-xbinnumber', 'X - Nb. of bins'),
 			this.addStandardInteger('histo2d-ybinnumber', 'Y - Nb. of bins'),
-			this.addStandardInteger('histo2d-smoothfactor', 'Smooth factor')
+			this.addStandardInteger('histo2d-smoothfactor', 'Smooth factor'),
+			this.addColorMapCombo('histo2d-color-map', function(name, newValue, oldValue){
+				me.parentObject.axes().getById('color').set('axis-color-map', newValue);
+			})
 			
 		];
 		return histogram2DItems;
--
libgit2 0.21.2