Skip to content

Commit

Permalink
Merge pull request #448 from GNS-Science/feature/444_opacity_slider
Browse files Browse the repository at this point in the history
Feature/444 opacity slider
  • Loading branch information
benjamineac authored Mar 8, 2024
2 parents e9ef53c + 6808394 commit 0b1e30e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_test_to_s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
environment: AWS_TEST
environment: AWS_PROD

strategy:
matrix:
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/HazardCurves.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable cypress/no-unnecessary-waiting */
/* eslint-disable cypress/unsafe-to-chain-command */
describe("Hazard Curves", () => {
before(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/LeafletMap/LeafletMap.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface LeafletMapProps {
timeDimension?: boolean;
timeDimensionOptions?: TimeDimensionOptions;
timeDimensionControlOptions?: TimeDimensionControlOptions;
timeDimensionGeoJsonData?: typeof GeoJsonObject[];
timeDimensionGeoJsonData?: (typeof GeoJsonObject)[];
timeDimensionUnderlay?: typeof GeoJsonObject;
setZoomLevel: (setZoomLevel: number) => void;
setTimeDimensionNeedsMore?: (setTimeDimensionNeedsMore: boolean) => void;
Expand Down Expand Up @@ -57,7 +57,7 @@ export interface LeafletLayersProps {
zoomLevel: number;
setZoomLevel: (setZoomLevel: number) => void;
timeDimension?: boolean;
timeDimensionGeoJsonData?: typeof GeoJsonObject[];
timeDimensionGeoJsonData?: (typeof GeoJsonObject)[];
timeDimensionUnderlay?: typeof GeoJsonObject;
setTimeDimensionHasNoMore?: (setTimeDimensionHasNoMore: boolean) => void;
setTimeDimensionNeedsMore?: (setTimeDimensionNeedsMore: boolean) => void;
Expand All @@ -66,7 +66,7 @@ export interface LeafletLayersProps {
}

export interface TimeDimensionLayerProps {
geoJsonData: typeof GeoJsonObject[];
geoJsonData: (typeof GeoJsonObject)[];
setTimeDimensionHasNoMore: (setTimeDimensionHasNoMore: boolean) => void;
setTimeDimensionNeedsMore: (setTimeDimensionNeedsMore: boolean) => void;
surfaceProperties: SurfaceProperties[];
Expand Down
2 changes: 1 addition & 1 deletion src/views/comboRuptureMap/ComboRuptureMapComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const ComboRuptureMapComponent = (props: ComboRuptureMapComponentProps) =
}, [data]);

const timeDimensionLayerProps = {
geoJsonData: (ruptureData as typeof GeoJsonObject[]) || "",
geoJsonData: (ruptureData as (typeof GeoJsonObject)[]) || "",
setTimeDimensionNeedsMore: setNeedsMore,
setTimeDimensionHasNoMore: setHasNoMore,
surfaceProperties: surfaceProperties || [],
Expand Down
3 changes: 2 additions & 1 deletion src/views/hazardCharts/constants/hazardCharts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const tooManyCurves = `Maximum of ${HAZARD_COLOR_LIMIT} curves can be sho

export const locationTooltip = "Standard model locations are provided for larger population centres.";

export const latLonTooltip = 'Coordinates in lat,lon form (WGS84). For multiple locations use the `;` separator. Values will be rounded to the nearest location on the NSHM model grid.';
export const latLonTooltip =
"Coordinates in lat,lon form (WGS84). For multiple locations use the `;` separator. Values will be rounded to the nearest location on the NSHM model grid.";

export const noLocations = "Please enter at least one location";

Expand Down
4 changes: 2 additions & 2 deletions src/views/hazardMaps/HazardMapsControls.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import { Box, Button, Slider, styled } from "@mui/material";
import { Box, Button, styled } from "@mui/material";
import { SelectControl } from "@gns-science/toshi-nest";
import { toPng } from "html-to-image";

Expand Down Expand Up @@ -79,7 +79,7 @@ const HazardMapsControls: React.FC<HazardMapsControlsProps> = ({
color_scale_vmax: MAP_GRID_VMAX,
fill_opacity: Number(gridOpacity / 100),
stroke_width: MAP_GRID_STROKE_WIDTH,
stroke_opacity: 0,
stroke_opacity: 0.0,
});
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/views/hazardMaps/HazardMapsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const hazardMapsPageQuery = graphql`
color_scale_vmax: $color_scale_vmax
fill_opacity: $fill_opacity
stroke_width: $stroke_width
stroke_opacity: 0
stroke_opacity: $stroke_opacity
color_scale_normalise: $color_scale_normalise
) {
geojson
Expand Down

0 comments on commit 0b1e30e

Please sign in to comment.