Skip to content

Commit

Permalink
Fixing color opacity on map for today (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinmatte authored Oct 31, 2023
1 parent 8e40926 commit a405018
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/slowzones/map/SlowZonesMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { SlowZonesLineName } from '../types';
import type { SegmentLabel, TooltipSide } from '../../../common/components/maps/LineMap';
import { getSlowZoneOpacity } from '../../../common/utils/slowZoneUtils';
import { useDelimitatedRoute } from '../../../common/utils/router';
import { TODAY_STRING } from '../../../common/constants/dates';
import { segmentSlowZones } from './segment';
import { SlowSegmentLabel } from './SlowSegmentLabel';
import { SlowZonesTooltip } from './SlowZonesTooltip';
Expand Down Expand Up @@ -106,7 +107,11 @@ export const SlowZonesMap: React.FC<SlowZonesMapProps> = ({
],
strokes: Object.entries(segment.slowZones).map(([direction, zones]) => {
const offset = direction === '0' ? 1 : -1;
const totalDelay = zones.reduce((sum, zone) => sum + zone.delay, 0);
const isToday = endDate === TODAY_STRING;
const totalDelay = zones.reduce(
(sum, zone) => sum + (isToday && zone.latest_delay ? zone.latest_delay : zone.delay),
0
);
return {
offset,
stroke: line.color,
Expand Down

0 comments on commit a405018

Please sign in to comment.