Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
COR-749 Fix responsive Choropleth sizing (#4293)
Browse files Browse the repository at this point in the history
* fix: remove minHeight for vr and gm pages choropleth

* fix: only set minHeight when provided

* fix: remove console.log

* fix: code cleanup

Co-authored-by: VWSCoronaDashboard24 <[email protected]>
  • Loading branch information
VWSCoronaDashboard24 and VWSCoronaDashboard24 authored Jun 22, 2022
1 parent 73de54a commit 7cb987d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export type CanvasChoroplethMapProps = {
fitExtent: FitExtent;
getFeatureName: (code: string) => string;
height: number;
minHeight?: number;
isTabInteractive: boolean;
mapProjection: () => GeoProjection;
tooltipTrigger: ChoroplethTooltipHandlers[2];
Expand All @@ -72,6 +73,7 @@ export const CanvasChoroplethMap = (props: CanvasChoroplethMapProps) => {
fitExtent,
getFeatureName,
height,
minHeight,
isTabInteractive,
mapProjection,
tooltipTrigger,
Expand Down Expand Up @@ -170,7 +172,7 @@ export const CanvasChoroplethMap = (props: CanvasChoroplethMapProps) => {
<div
ref={containerRef}
style={{
minHeight: height,
minHeight: minHeight && minHeight > 0 ? minHeight : 'inherit',
maxHeight: '75vh',
maxWidth: '100%',
height: '100%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export const ChoroplethMap: <T extends ChoroplethDataItem>(
dataOptions={dataOptions}
width={width}
height={correctedHeight}
minHeight={minHeight}
annotations={annotations}
featureOverHandler={featureOverHandler}
featureOutHandler={featureOutHandler}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/pages/gemeente/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Municipality = (props: StaticProps<typeof getStaticProps>) => {
}}
map="gm"
data={data}
minHeight={900}
minHeight={0}
dataConfig={{
metricName: 'gemeente' as any,
metricProperty: 'admissions_on_date_of_admission',
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/pages/veiligheidsregio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const VrIndexPage = (props: StaticProps<typeof getStaticProps>) => {
}}
map="vr"
data={data}
minHeight={900}
minHeight={0}
dataConfig={{
metricName: 'veiligheidsregio' as any,
metricProperty: 'admissions_on_date_of_admission',
Expand Down

0 comments on commit 7cb987d

Please sign in to comment.