Skip to content

Update in operation map for crisis categorization#2282

Merged
frozenhelium merged 3 commits intoproject/surge-eru-updatefrom
feat/operation-map-update
Mar 26, 2026
Merged

Update in operation map for crisis categorization#2282
frozenhelium merged 3 commits intoproject/surge-eru-updatefrom
feat/operation-map-update

Conversation

@shreeyash07
Copy link
Copy Markdown
Collaborator

@shreeyash07 shreeyash07 commented Mar 17, 2026

Addresses

Depends On

Changes

  • Create new component for active operation map Container
  • Add tabs for crisis categorization and appeals type map
  • Add new base point layer for crisis categorization

This PR Ensures:

  • No typos or grammatical errors
  • No conflict markers left in the code
  • No unwanted comments, temporary files, or auto-generated files
  • No inclusion of secret keys or sensitive data
  • No console.log statements meant for debugging
  • All CI checks have passed

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 17, 2026

🦋 Changeset detected

Latest commit: 9580ed3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
go-web-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@shreeyash07 shreeyash07 force-pushed the feat/operation-map-update branch 3 times, most recently from 8a4dcf5 to 6e29f18 Compare March 18, 2026 10:56
@shreeyash07 shreeyash07 changed the base branch from develop to project/surge-eru-update March 18, 2026 11:00
bbox: LngLatBoundsLike | undefined;
appealResponse?: AppealResponse;
legendOptions: LegendOptions[];
setPresentationMode: (presentation: boolean) => void;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setPresentationMode implies an action to set the presentation mode, but this is a callback indicating the change. Let's update the prop name to reflect what it does!

Suggested change
setPresentationMode: (presentation: boolean) => void;
onPresentationModeChange: (presentationMode: boolean) => void;

Comment on lines +111 to +185
const crisisCircleColor: CirclePaint['circle-color'] = [
'match',
['get', 'severityLevel'],
DISASTER_CATEGORY_ORANGE,
COLOR_ORANGE_SEVERITY,
DISASTER_CATEGORY_RED,
COLOR_RED_SEVERITY,
DISASTER_CATEGORY_YELLOW,
COLOR_YELLOW_SEVERITY,
DISASTER_UNCATEGORISED,
COLOR_BLACK,
DISASTER_MULTIPLE,
COLOR_GREEN,
COLOR_LIGHT_BLUE,
];

const crisisBasePointPaint: CirclePaint = {
'circle-radius': 5,
'circle-color': crisisCircleColor,
'circle-opacity': 0.8,
};

export const crisisBasePointLayerOptions: Omit<CircleLayer, 'id'> = {
type: 'circle',
paint: crisisBasePointPaint,
};

const crisisBaseOuterCirclePaint: CirclePaint = {
'circle-color': crisisCircleColor,
'circle-opacity': 0.4,
};

const crisisOuterCirclePaintForFinancialRequirements: CirclePaint = {
...crisisBaseOuterCirclePaint,
'circle-radius': [
'interpolate',
['linear', 1],
['get', 'financialRequirements'],
1000,
7,
10000,
9,
100000,
11,
1000000,
15,
],
};

const crisisOuterCirclePaintForPeopleTargeted: CirclePaint = {
...crisisBaseOuterCirclePaint,
'circle-radius': [
'interpolate',
['linear', 1],
['get', 'peopleTargeted'],
1000,
7,
10000,
9,
100000,
11,
1000000,
15,
],
};

export const crisisOuterCircleLayerOptionsForFinancialRequirements: Omit<CircleLayer, 'id'> = {
type: 'circle',
paint: crisisOuterCirclePaintForFinancialRequirements,
};

export const crisisOuterCircleLayerOptionsForPeopleTargeted: Omit<CircleLayer, 'id'> = {
type: 'circle',
paint: crisisOuterCirclePaintForPeopleTargeted,
};
Copy link
Copy Markdown
Member

@frozenhelium frozenhelium Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to separate out any of these, we can just add one more condition to circleColor and switch by variant

Comment on lines +231 to +242
const layerOptions = useMemo(() => {
if (variant === 'crisis') {
if (scaleBy === 'peopleTargeted') {
return crisisOuterCircleLayerOptionsForPeopleTargeted;
}
return crisisOuterCircleLayerOptionsForFinancialRequirements;
}
if (scaleBy === 'peopleTargeted') {
return outerCircleLayerOptionsForPeopleTargeted;
}
return outerCircleLayerOptionsForFinancialRequirements;
}, [variant, scaleBy]);
Copy link
Copy Markdown
Member

@frozenhelium frozenhelium Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to separate this out, it's better if the switch happens in the mapbox expression

>
<MapLayer
layerKey="point-circle"
layerOptions={variant === 'crisis' ? crisisBasePointLayerOptions : basePointLayerOptions}
Copy link
Copy Markdown
Member

@frozenhelium frozenhelium Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to separate this out, it'll remount the whole component, let's use mapbox expression instead

Comment on lines +195 to +200
properties: {
id: country.iso3,
appealType: operation.appealType,
severityLevel: operation.severityLevel,
peopleTargeted: operation.peopleTargeted,
financialRequirements: operation.financialRequirements,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can pass on variant here, and conditionally update the circle color

[appealResponse],
);

const countryCentroidGeoJson = useMemo((): GeoJSON.FeatureCollection<GeoJSON.Geometry> => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since, we're separating out MapContainer, data related part should reside in ActiveOperationMap

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this, separating by variant won’t make sense. The variant won’t be used inside the child component, and we might need to use another UI component (like a segmented input) instead of tabs.

- Create new component for active operation map Container
- Add tabs for crisis categorization and appeals type map
- Add new base point layer for crisis categorization
@shreeyash07 shreeyash07 force-pushed the feat/operation-map-update branch from f8fdc74 to 9580ed3 Compare March 26, 2026 08:52
));
return highestSeverity[0];
}
if (uniqueEventList.length === 0) return DISASTER_UNCATEGORISED;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the first statement

@frozenhelium frozenhelium merged commit 202d527 into project/surge-eru-update Mar 26, 2026
18 checks passed
@frozenhelium frozenhelium deleted the feat/operation-map-update branch March 26, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants