Skip to content

Commit 9e0f3e6

Browse files
committed
now saving them for Graduated
1 parent 590f8c6 commit 9e0f3e6

File tree

3 files changed

+6
-33
lines changed

3 files changed

+6
-33
lines changed

packages/base/src/dialogs/symbology/components/color_ramp/ColorRampControls.tsx

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -144,37 +144,6 @@ const ColorRampControls: React.FC<IColorRampControlsProps> = ({
144144
return;
145145
}
146146

147-
// update shared model symbology state from component state
148-
useEffect(() => {
149-
if (renderType === 'Heatmap') {
150-
return;
151-
}
152-
153-
if (!layerParams.symbologyState) {
154-
layerParams.symbologyState = {};
155-
}
156-
layerParams.symbologyState = {
157-
...layerParams.symbologyState,
158-
dataMin,
159-
dataMax,
160-
min: minValue,
161-
max: maxValue,
162-
colorRamp: selectedRamp,
163-
reverse: reverseRamp,
164-
nClasses: numberOfShades,
165-
mode: selectedMode,
166-
};
167-
}, [
168-
minValue,
169-
maxValue,
170-
selectedRamp,
171-
reverseRamp,
172-
selectedMode,
173-
numberOfShades,
174-
dataMin,
175-
dataMax,
176-
]);
177-
178147
return (
179148
<div className="jp-gis-color-ramp-container">
180149
{showRampSelector && (

packages/base/src/dialogs/symbology/components/color_ramp/ColorRampValueControls.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Button } from '@jupyterlab/ui-components';
22
import React from 'react';
33

4-
import { IColorRampDefinition } from '@/src/types';
4+
import { IColorRampDefinition, ClassificationMode } from '@/src/types';
55

66
export interface IColorRampValueControlsProps {
77
selectedMin: number | undefined;
@@ -16,7 +16,7 @@ export interface IColorRampValueControlsProps {
1616
| 'Singleband Pseudocolor';
1717
dataMin?: number;
1818
dataMax?: number;
19-
selectedMode: string; // TODO: should be ClssificationMode (https://github.com/geojupyter/jupytergis/pull/937)
19+
selectedMode: ClassificationMode;
2020
}
2121
export const ColorRampValueControls: React.FC<
2222
IColorRampValueControlsProps

packages/base/src/dialogs/symbology/vector_layer/types/Graduated.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ const Graduated: React.FC<ISymbologyTabbedDialogWithAttributesProps> = ({
208208
mode: colorRampOptionsRef.current?.selectedMode,
209209
min: colorRampOptionsRef.current?.minValue,
210210
max: colorRampOptionsRef.current?.maxValue,
211+
dataMin: colorRampOptionsRef.current?.dataMin,
212+
dataMax: colorRampOptionsRef.current?.dataMax,
211213
};
212214

213215
if (layer.type === 'HeatmapLayer') {
@@ -236,6 +238,8 @@ const Graduated: React.FC<ISymbologyTabbedDialogWithAttributesProps> = ({
236238
minValue,
237239
maxValue,
238240
criticalValue,
241+
dataMin,
242+
dataMax,
239243
});
240244

241245
let stops: number[];

0 commit comments

Comments
 (0)