Skip to content

Commit

Permalink
fix: Color and radius issues for undefined observations
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Dec 2, 2021
1 parent 5118f10 commit c5597e1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/charts/map/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ export const MapComponent = () => {
getLineWidth={100}
updateTriggers={{ getFillColor: getColor }}
getFillColor={(d: GeoShapeFeature) =>
getColor(getValue(d.properties.observation))
getColor(
d.properties.observation
? getValue(d.properties.observation)
: null
)
}
getLineColor={[255, 255, 255]}
/>
Expand Down Expand Up @@ -277,7 +281,9 @@ export const MapComponent = () => {
lineWidthMinPixels={1}
getPosition={(d: GeoPoint) => d.coordinates}
getRadius={(d: GeoPoint) =>
radiusScale(getRadius(d.properties.observation) ?? 0)
d.properties.observation
? radiusScale(getRadius(d.properties.observation) as number)
: 0
}
getFillColor={[0, 102, 153]}
getLineColor={[255, 255, 255]}
Expand Down

0 comments on commit c5597e1

Please sign in to comment.