1+ /**
2+ * @module ColorRampControls
3+ *
4+ * This component provides the main UI controls for classifying raster layers
5+ * using different color ramps and classification modes.
6+ *
7+ * Allows users to:
8+ * - Select a color ramp (`ColorRampSelector`)
9+ * - Choose classification mode and number of classes (`ModeSelectRow`)
10+ * - Run classification via `classifyFunc`, with loading state (`LoadingIcon`)
11+ *
12+ * Props:
13+ * - `modeOptions`: Available classification modes.
14+ * - `layerParams`: Layer symbology state.
15+ * - `classifyFunc`: Callback for classification.
16+ * - `showModeRow`: Toggle for mode selector.
17+ * - `showRampSelector`: Toggle for ramp selector.
18+ */
19+
120import { IDict } from '@jupytergis/schema' ;
221import { Button } from '@jupyterlab/ui-components' ;
322import React , { useEffect , useState } from 'react' ;
423
524import { COLOR_RAMP_DEFINITIONS } from '@/src/dialogs/symbology/colorRamps' ;
625import { LoadingIcon } from '@/src/shared/components/loading' ;
7- import { ColorRampName , COLOR_RAMP_DEFAULTS } from '@/src/types' ;
8- import CanvasSelectComponent from './CanvasSelectComponent ' ;
26+ import { COLOR_RAMP_DEFAULTS , ColorRampName } from '@/src/types' ;
27+ import ColorRampSelector from './ColorRampSelector ' ;
928import { ColorRampValueControls } from './ColorRampValueControls' ;
1029import ModeSelectRow from './ModeSelectRow' ;
1130
12- interface IColorRampProps {
31+ interface IColorRampControlsProps {
1332 modeOptions : string [ ] ;
1433 layerParams : IDict ;
1534 classifyFunc : (
@@ -33,17 +52,17 @@ interface IColorRampProps {
3352 dataMax ?: number ;
3453}
3554
36- export type ColorRampOptions = {
37- selectedRamp : ColorRampName ;
38- reverseRamp : boolean ;
55+ export type ColorRampControlsOptions = {
56+ selectedRamp : string ;
3957 numberOfShades : string ;
4058 selectedMode : string ;
4159 minValue : number ;
4260 maxValue : number ;
4361 criticalValue ?: number ;
62+ reverseRamp : boolean ;
4463} ;
4564
46- const ColorRamp : React . FC < IColorRampProps > = ( {
65+ const ColorRampControls : React . FC < IColorRampControlsProps > = ( {
4766 layerParams,
4867 modeOptions,
4968 classifyFunc,
@@ -172,7 +191,7 @@ const ColorRamp: React.FC<IColorRampProps> = ({
172191 { showRampSelector && (
173192 < div className = "jp-gis-symbology-row" >
174193 < label htmlFor = "color-ramp-select" > Color Ramp:</ label >
175- < CanvasSelectComponent
194+ < ColorRampSelector
176195 selectedRamp = { selectedRamp }
177196 setSelected = { setSelectedRamp }
178197 reverse = { reverseRamp }
@@ -242,4 +261,4 @@ const ColorRamp: React.FC<IColorRampProps> = ({
242261 ) ;
243262} ;
244263
245- export default ColorRamp ;
264+ export default ColorRampControls ;
0 commit comments