Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/update disclaimers #52

Merged
merged 42 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c7ee6cd
Try this
amarouane-ABDELHAK Oct 2, 2024
4e5191b
Merge remote-tracking branch 'origin/main' into eic-address-findings
dzole0311 Oct 3, 2024
15c5b64
Address findings
dzole0311 Oct 3, 2024
72ef7b8
Add short name for the select box for each scenario
dzole0311 Oct 3, 2024
31d0a7b
Update scenarios and trigger build
dzole0311 Oct 3, 2024
532d05c
Merge pull request #43 from NASA-IMPACT/eic-address-findings
dzole0311 Oct 3, 2024
7170a33
Merge branch 'develop' of https://github.com/NASA-IMPACT/EIC-Mobile i…
amarouane-ABDELHAK Oct 3, 2024
0621c3b
Merge branch 'main' into develop
amarouane-ABDELHAK Oct 3, 2024
5105f95
Add hotfix possibility for main
amarouane-ABDELHAK Oct 3, 2024
8c60031
Add new videos
dzole0311 Oct 4, 2024
54b8198
Merge pull request #49 from NASA-IMPACT/add-new-videos
dzole0311 Oct 4, 2024
af3c1b8
Fix video rendering changes
dzole0311 Oct 4, 2024
0810f1c
Merge pull request #50 from NASA-IMPACT/fix-videos-rendering
dzole0311 Oct 4, 2024
643add2
Increase opacity of LineChart inactive scenarios
dzole0311 Oct 4, 2024
f8221f4
Handle loading state when fetching samples
dzole0311 Oct 4, 2024
5706b31
Add circle buffer
dzole0311 Oct 4, 2024
f0da987
Update invalid data msg content
dzole0311 Oct 4, 2024
52f8d3d
Scale buffer on zoom
dzole0311 Oct 4, 2024
5143804
Add deps
dzole0311 Oct 4, 2024
fa2b740
Revert scaling of buffer
dzole0311 Oct 4, 2024
80e52f2
Apply rescaling
dzole0311 Oct 4, 2024
3688943
Update tour text to geographic area
freitagb Oct 4, 2024
f35db90
Update DataLayerModal.tsx with updated disclaimer
freitagb Oct 4, 2024
a1ae5c5
Update Map.jsx cursor
freitagb Oct 4, 2024
7bd9f49
add disclaimer image
freitagb Oct 4, 2024
e0e3e0f
Update DataLayerModal.tsx with image?
freitagb Oct 4, 2024
37b9eea
fix blue circle drag; it was being left behind. hopefully there is no…
agurvich Oct 4, 2024
cbbb065
Rename main [email protected] to temp-disclaimer.svg
freitagb Oct 4, 2024
7625831
Delete src/assets/temp-disclaimer.svg
freitagb Oct 4, 2024
ca0bd38
add temp disclaimer image
freitagb Oct 4, 2024
891c33b
Update DataLayerModal.tsx
freitagb Oct 4, 2024
59234f8
add square to represent dataset resolution
agurvich Oct 4, 2024
f4af810
snap to grid and add a square (note not sure that it's ACTUALLY 0.25 …
agurvich Oct 4, 2024
613de74
Merge branch 'hotfix/update-disclaimers' of github.com:NASA-IMPACT/EI…
agurvich Oct 4, 2024
7323978
bugfix for image embed on temperature modal
agurvich Oct 4, 2024
fd61bd7
replace big svg with small png
agurvich Oct 4, 2024
4be017d
makings of a two page modal
agurvich Oct 4, 2024
f380dab
move disclaimer out of temperature data modal and into joyride stage
agurvich Oct 4, 2024
7e7f400
fix grammar in data layer modal
freitagb Oct 4, 2024
c80fa73
Fix grammar in tour text
freitagb Oct 4, 2024
8448849
adding back NEX-GDDP disclaimer text (can remove if approved)
freitagb Oct 4, 2024
1bf5ff1
correct formatting for disclaimer
freitagb Oct 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/gitflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check branch
if: github.base_ref == 'main' && github.head_ref != 'develop'
if: github.base_ref == 'main' && (github.head_ref != 'develop' && !startsWith(github.head_ref, 'hotfix/'))
run: |
echo "ERROR: You can only merge to main from develop"
echo "ERROR: You can only merge to main from develop or hotfix/* branches"
exit 1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ This project follows a Gitflow branching model:

- Main Branch: The main branch is also protected and only accepts pull requests from the development branch.


## Configuration

The ```config.json``` file is a vital metadata file that points the application to the proper video and image service endpoints. For the application to run properly, it’s important to configure the file according to the following parameters.
Expand Down
8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="./src/assets/eic.svg" />
<link rel='icon' sizes='any' href='https://earth.gov/meta/favicon.ico' />
<link rel='icon' type='image/svg+xml' href='https://earth.gov/meta/icon.svg' />
<link rel='apple-touch-icon' sizes='180x180' href='https://earth.gov/meta/apple-touch-icon.png' />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Manrope:[email protected]&display=swap" rel="stylesheet">
<title>EIC Mobile</title>
<title>Mobile Climate Mapper</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./src/main.jsx"></script>
</body>
</html>


38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
"chartjs-plugin-annotation": "^3.0.1",
"chartjs-plugin-crosshair": "^2.0.0",
"date-fns": "^3.6.0",
"lodash": "^4.17.21",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet": "^6.1.0",
"react-joyride": "^2.9.2",
"react-share": "^5.1.0",
"styled-components": "^6.1.12"
Expand Down
Binary file removed public/composited_2fps_g1_crf18.mp4
Binary file not shown.
Binary file removed public/composited_3fps_g1_crf18.mp4
Binary file not shown.
Binary file added public/first_frame_ssp126.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/first_frame_ssp245.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/first_frame_ssp370.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/first_frame_ssp585.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added public/monthly_max_ssp126_max12_8192_512x256.mp4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/monthly_max_ssp370_max12_8192_1024x512.mp4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/monthly_max_ssp585_max12_8192_512x256.mp4
Binary file not shown.
Binary file not shown.
Binary file removed public/tasmax_monthly_ssp126_first_frame.png
Binary file not shown.
Binary file removed public/tasmax_monthly_ssp126_max12_8192_1024x512.mp4
Binary file not shown.
Binary file removed public/tasmax_monthly_ssp126_max12_8192_512x256.mp4
Binary file not shown.
Binary file not shown.
Binary file removed public/tasmax_monthly_ssp245_first_frame.png
Binary file not shown.
Binary file removed public/tasmax_monthly_ssp245_max12_8192_512x256.mp4
Binary file not shown.
Binary file not shown.
Binary file removed public/tasmax_monthly_ssp370_first_frame.png
Binary file not shown.
Binary file removed public/tasmax_monthly_ssp370_max12_8192_512x256.mp4
Binary file not shown.
Binary file not shown.
Binary file removed public/tasmax_monthly_ssp585_first_frame.png
Binary file not shown.
Binary file removed public/tasmax_monthly_ssp585_max12_8192_512x256.mp4
Binary file not shown.
Binary file added public/temp-disclaimer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 19 additions & 16 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ErrorContext
} from './contexts/AppContext';
import { VideoProvider } from './contexts/VideoContext';
import { DataFetchingProvider } from './contexts/DataFetchingContext';
import config from './config.json';
import RotateOverlay from './components/RotateOverlay';
import Tour from './components/Tour';
Expand All @@ -34,22 +35,24 @@ export default function App() {
<ChartDataContext.Provider
value={{ chartData, setChartData }}
>
{hasWebGLError ? (
<div>
Your WebGL implementation doesn't seem to
support hardware accelerated rendering.
Check your browser settings or if your GPU
is in a blocklist.
</div>
) : (
<>
<Tour />
<RotateOverlay />
<EICLogo />
<Panel />
<Map />
</>
)}
<DataFetchingProvider>
{hasWebGLError ? (
<div>
Your WebGL implementation doesn't seem
to support hardware accelerated
rendering. Check your browser settings
or if your GPU is in a blocklist.
</div>
) : (
<>
<Tour />
<RotateOverlay />
<EICLogo />
<Panel />
<Map />
</>
)}
</DataFetchingProvider>
</ChartDataContext.Provider>
</VideoProvider>
</DataSelectionContext.Provider>
Expand Down
158 changes: 123 additions & 35 deletions src/components/DataLayerModal.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React, { useEffect } from 'react';
import React, { useEffect, useState } from 'react';

export default function DataLayerModal({
closeModal,
isFahrenheit,
setIsFahrenheit
}) {

const [ showPageTwo, setShowPageTwo ] = useState(false);

useEffect(() => {
const handleKeyDown = (event) => {
if (event.key === 'Escape') {
Expand Down Expand Up @@ -43,42 +46,127 @@ export default function DataLayerModal({
</h2>

<div className="w-full max-w-[760px] bg-transparent">
<p className="text-[16px] text-gray-300 text-left mb-6 leading-[24px]">
How hot could it get on the hottest day in a given year, under different greenhouse gas emission scenarios? </p>
<p className="text-[16px] text-gray-300 text-left mb-6 leading-[24px]">
See estimates of annual maxima of daily maximum near-surface air temperature (TASMAX) from NASA Earth Exchange (NEX) Global Daily Downscaled Projections (GDDP) based on simulations of the Coupled Model Intercomparison Project Phase 6 (CMIP6). </p>
<p className="text-[16px] text-gray-300 text-left mb-6 leading-[24px]">
The NEX-GDDP-CMIP6 data is calculated on a 0.25°x0.25° latitude and longitude grid and temperature in major cities could be higher than what is displayed within each gridded cell. </p>
<div className="flex justify-start mt-8">
<button
className={`px-4 py-2 border rounded-l-lg text-[14px] font-semibold transition-colors ${
isFahrenheit ? 'bg-[#14367D] text-white' : 'bg-gray-800 text-gray-400'
}`}
style={{
borderRadius: '4px 0 0 4px',
padding: '8px 12px',
border: '1px solid #FFFFFF26',
}}
onClick={() => setIsFahrenheit(true)}
>
Fahrenheit (°F)
</button>
<button
className={`px-4 py-2 border rounded-r-lg text-[14px] font-semibold transition-colors ${
!isFahrenheit ? 'bg-[#14367D] text-white' : 'bg-gray-800 text-gray-400'
}`}
style={{
borderRadius: '0 4px 4px 0',
padding: '8px 12px',
border: '1px solid #FFFFFF26',
}}
onClick={() => setIsFahrenheit(false)}
>
Celsius (°C)
</button>
</div>
{ showPageTwo ? <PageTwo /> : <PageOne /> }
{/* <SwapButton {...{setShowPageTwo}} /> */}
<Buttons {...{isFahrenheit, setIsFahrenheit}}/>
</div>
</div>
</div>
);
}

function PageTwo({}){
// ABG: https://cdn.dribbble.com/users/716122/screenshots/14300379/media/44f698e864671ffe25b844469e40de42.jpg?resize=400x300&vertical=center
return(
<>
<div className='w-full flex flex-row justify-center'>
<img
className='w-4/5'
src="temp-disclaimer.png"
alt="Example of spatial average of temperature for Los Angeles, CA"
/>
</div>
<Disclaimer className={'border rounded-lg border-gray-300/50 p-2 overflow-y-scroll'} />
</>
);

}
function PageOne({}){

return (
<div className="text-[16px] text-gray-300 text-left mb-6 leading-[24px]">
<p>
How hot could it get on the hottest day in a given year, under different greenhouse gas emission scenarios?
</p>
<br/>
<p>
See estimates of annual maxima of daily maximum near-surface air temperature (TASMAX) from NASA Earth Exchange (NEX) Global Daily Downscaled Projections (GDDP) based on simulations of the Coupled Model Intercomparison Project Phase 6 (CMIP6).
</p>
<br/>
<p>
The NEX-GDDP-CMIP6 data is calculated on a 0.25°x0.25° latitude and longitude grid, which is a system of lines used to map the sphere of the Earth.
In some cases, the temperature in major cities could be higher than what’s displayed in the gridded cell because it includes a larger area than just that city.
For example, if you search for a city, such as Los Angeles, CA the average will include the temperature of Los Angeles (which could be higher than average) plus the surrounding geographical area (which could be lower than average).
</p>
<br/>
<p>
Learn more about the
{' '}
<a
href="https://earth.gov/data-catalog/cmip6-climdex-tasmax-yearly-median"
className='underline'
>
NEX-GDDP-CMIP6 dataset
</a>!
</p>
</div>
);
}

function Buttons({isFahrenheit, setIsFahrenheit}){
return (
<div className="flex justify-start mt-8">
<button
className={`px-4 py-2 border rounded-l-lg text-[14px] font-semibold transition-colors ${
isFahrenheit ? 'bg-[#14367D] text-white' : 'bg-gray-800 text-gray-400'
}`}
style={{
borderRadius: '4px 0 0 4px',
padding: '8px 12px',
border: '1px solid #FFFFFF26',
}}
onClick={() => setIsFahrenheit(true)}
>
Fahrenheit (°F)
</button>
<button
className={`px-4 py-2 border rounded-r-lg text-[14px] font-semibold transition-colors ${
!isFahrenheit ? 'bg-[#14367D] text-white' : 'bg-gray-800 text-gray-400'
}`}
style={{
borderRadius: '0 4px 4px 0',
padding: '8px 12px',
border: '1px solid #FFFFFF26',
}}
onClick={() => setIsFahrenheit(false)}
>
Celsius (°C)
</button>
</div>
);
}

export function Disclaimer({className}){

return (
<p className={`
h-1/4 text-[16px]
text-gray-300
text-left
mb-6
leading-[24px]
${className}
`}
>
The NEX-GDDP-CMIP6 data is calculated on a 0.25°x0.25° latitude and longitude grid, which is a system of lines used to map the sphere of the Earth.
In some cases, the temperature in major cities could be higher than what’s displayed in the gridded cell because it includes a larger area than just that city.
For example, if you search for a city, such as Los Angeles, CA the average will include the temperature of Los Angeles (which could be higher than average) plus the surrounding geographical area (which could be lower than average).
</p>

);

}

function SwapButton({setShowPageTwo}){
return <button
className={`px-4 py-2 border rounded-l-lg text-[14px] font-semibold bg-[#14367D] text-white `}
style={{
borderRadius: '4px 0 0 4px',
padding: '8px 12px',
border: '1px solid #FFFFFF26',
}}
onClick={() => setShowPageTwo(prevShowPageTwo => ! prevShowPageTwo)}
>
Swap pages
</button>
}
8 changes: 4 additions & 4 deletions src/components/LineChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function LineChart({ selectedIndex, isFahrenheit }) {
borderColor:
selectedIndex === 0
? '#FFFFFFBF'
: 'rgba(239, 239, 240, 0.2)',
: 'rgba(239, 239, 240, 0.4)',
borderWidth: selectedIndex === 0 ? 1 : 0.5,
fill: false,
pointRadius: 0
Expand All @@ -72,7 +72,7 @@ export default function LineChart({ selectedIndex, isFahrenheit }) {
borderColor:
selectedIndex === 1
? '#FFFFFFBF'
: 'rgba(239, 239, 240, 0.2)',
: 'rgba(239, 239, 240, 0.4)',
borderWidth: selectedIndex === 1 ? 1 : 0.5,
fill: false,
pointRadius: 0
Expand All @@ -85,7 +85,7 @@ export default function LineChart({ selectedIndex, isFahrenheit }) {
borderColor:
selectedIndex === 2
? '#FFFFFFBF'
: 'rgba(239, 239, 240, 0.2)',
: 'rgba(239, 239, 240, 0.4)',
borderWidth: selectedIndex === 2 ? 1 : 0.5,
fill: false,
pointRadius: 0
Expand All @@ -98,7 +98,7 @@ export default function LineChart({ selectedIndex, isFahrenheit }) {
borderColor:
selectedIndex === 3
? '#FFFFFFBF'
: 'rgba(239, 239, 240, 0.2)',
: 'rgba(239, 239, 240, 0.4)',
borderWidth: selectedIndex === 3 ? 1 : 0.5,
fill: false,
pointRadius: 0
Expand Down
Loading