Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions .github/workflows/deploy-urban.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ jobs:

# Check for required variables
[ -z "${{ secrets.REACT_APP_MAPBOX_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_ACCESS_TOKEN")
[ -z "${{ secrets.REACT_APP_MAPBOX_STYLE_URL }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_STYLE_URL")
[ -z "${{ vars.REACT_APP_BASE_PATH_URBAN }}" ] && missing_vars+=("vars.REACT_APP_BASE_PATH_URBAN")
[ -z "${{ secrets.DEPLOYMENT_ROLE_ARN }}" ] && missing_vars+=("secrets.DEPLOYMENT_ROLE_ARN")
[ -z "${{ secrets.CF_DISTRIBUTION_ID }}" ] && missing_vars+=("secrets.CF_DISTRIBUTION_ID")
[ -z "${{ vars.REACT_APP_GRAPES_DATASET_PAGE_URL }}" ] && missing_vars+=("vars.REACT_APP_GRAPES_DATASET_PAGE_URL")
[ -z "${{ vars.REACT_APP_VULCAN_DATASET_PAGE_URL }}" ] && missing_vars+=("vars.REACT_APP_VULCAN_DATASET_PAGE_URL")

# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
Expand All @@ -73,10 +74,10 @@ jobs:
working-directory: ./urban-dashboard
env:
REACT_APP_MAPBOX_TOKEN: ${{ secrets.REACT_APP_MAPBOX_ACCESS_TOKEN }}
REACT_APP_MAPBOX_STYLE_URL: ${{ secrets.REACT_APP_MAPBOX_STYLE_URL }}
REACT_APP_BASE_PATH: ${{ vars.REACT_APP_BASE_PATH_URBAN }}
PUBLIC_URL: ${{ vars.REACT_APP_BASE_PATH_URBAN }}
REACT_APP_BASEMAP_STYLES_MAPBOX_ID: ${{ secrets.REACT_APP_BASEMAP_STYLES_MAPBOX_ID}}
REACT_APP_GRAPES_DATASET_PAGE_URL: ${{ vars.REACT_APP_GRAPES_DATASET_PAGE_URL }}
REACT_APP_VULCAN_DATASET_PAGE_URL: ${{ vars.REACT_APP_VULCAN_DATASET_PAGE_URL }}
run: |
yarn
yarn build
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ jobs:
[ -z "${{ secrets.REACT_APP_MAPBOX_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_TOKEN")
[ -z "${{ secrets.REACT_APP_MAPBOX_STYLE_URL }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_STYLE_URL")
[ -z "${{ vars.REACT_APP_BASE_PATH_URBAN }}" ] && missing_vars+=("vars.REACT_APP_BASE_PATH_URBAN")
[ -z "${{ vars.REACT_APP_GRAPES_DATASET_PAGE_URL }}" ] && missing_vars+=("vars.REACT_APP_GRAPES_DATASET_PAGE_URL")
[ -z "${{ vars.REACT_APP_VULCAN_DATASET_PAGE_URL }}" ] && missing_vars+=("vars.REACT_APP_VULCAN_DATASET_PAGE_URL")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
Expand Down Expand Up @@ -215,6 +217,8 @@ jobs:
echo REACT_APP_BASEMAP_STYLES_MAPBOX_ID="${{ secrets.REACT_APP_BASEMAP_STYLES_MAPBOX_ID }}" >> ./urban-dashboard/.env
echo REACT_APP_BASE_PATH="${{ vars.REACT_APP_BASE_PATH_URBAN }}/${{ env.PR_STRING }}" >> ./urban-dashboard/.env
echo PUBLIC_URL="${{ vars.REACT_APP_BASE_PATH_URBAN }}/${{ env.PR_STRING }}" >> ./urban-dashboard/.env
echo REACT_APP_GRAPES_DATASET_PAGE_URL="${{ vars.REACT_APP_GRAPES_DATASET_PAGE_URL }}" >> ./urban-dashboard/.env
echo REACT_APP_VULCAN_DATASET_PAGE_URL="${{ vars.REACT_APP_VULCAN_DATASET_PAGE_URL }}" >> ./urban-dashboard/.env
cd ./urban-dashboard
set -a; source .env; set +a
yarn
Expand Down Expand Up @@ -272,6 +276,7 @@ jobs:
aws s3 rm s3://${{ env.S3_BUCKET }}${{ vars.PUBLIC_URL_NOAA }}/${{ env.PR_STRING }}/ --recursive
aws s3 rm s3://${{ env.S3_BUCKET }}${{ vars.PUBLIC_URL_NIST }}/${{ env.PR_STRING }}/ --recursive
aws s3 rm s3://${{ env.S3_BUCKET }}${{ vars.PUBLIC_URL_GOES }}/${{ env.PR_STRING }}/ --recursive
aws s3 rm s3://${{ env.S3_BUCKET }}${{ vars.REACT_APP_BASE_PATH_URBAN }}/${{ env.PR_STRING }}/ --recursive

- name: Remove PR comment
run: |
Expand Down
3 changes: 1 addition & 2 deletions noaa-cpfp-point/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ document.addEventListener("DOMContentLoaded", () => {
container: "map",
style: "mapbox://styles/mapbox/satellite-v9",
center: [-98.585522, 1.8333333], // Centered on the US
zoom: 2,
projection: 'equirectangular'
zoom: 2
});

// Parse query parameters from the URL
Expand Down
1 change: 0 additions & 1 deletion urban-dashboard/.env.local-sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
REACT_APP_MAPBOX_TOKEN='xxxxxxxxxx'
REACT_APP_MAPBOX_STYLE_URL='mapbox://styles/xxxxxxxxx'
PUBLIC_URL='xxxxxxx'
REACT_APP_BASEMAP_STYLES_MAPBOX_ID='xxxxxxx'
REACT_APP_DATA_URL='xxxxxxx'
4 changes: 2 additions & 2 deletions urban-dashboard/src/components/cards/dataset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function Grap2pesDatasetCard() {

<p>
{description}
<a target="opener" href="https://earth.gov/ghgcenter/data-catalog/gra2pes-ghg-monthgrid-v1"> Click here for more details.</a>
<a target="opener" href={process.env.REACT_APP_GRAPES_DATASET_PAGE_URL}> Click here for more details.</a>
</p>
</div>
)
Expand All @@ -39,7 +39,7 @@ export function VulcanDatasetCard() {
</Typography>
<p>
{description}
<a target="opener" href="https://earth.gov/ghgcenter/data-catalog/vulcan-ffco2-yeargrid-v4"> Click here for more details.</a>
<a target="opener" href={process.env.REACT_APP_VULCAN_DATASET_PAGE_URL}> Click here for more details.</a>
</p>
</div>
)
Expand Down
37 changes: 22 additions & 15 deletions urban-dashboard/src/components/dataInsights/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "chart.js";

import { Line, Pie } from "react-chartjs-2";
import { Typography, Grid, Box } from "@mui/material";
import { Typography, Grid, Box, Tooltip as MuiTooltip } from "@mui/material";
import "./index.css";
import { getVulcanData, getGra2pesData } from './helper/index'
import { useConfig } from "../../context/configContext";
Expand Down Expand Up @@ -312,36 +312,43 @@ const GasEmissionsBySectorCard = ({ selection }) => {

const Legend = () => {
return (
<Grid container spacing={0.3}>
<Grid container spacing={0.5}>
{LegendItems.map((item, index) => (
<Grid
item
xs={4}
xs={6}
sm={4}
key={index}
container
direction="row"
alignItems="center"
wrap="nowrap"
>
<Box
sx={{
width: 21,
height: 21,
minWidth: 21,
minHeight: 21,
backgroundColor: item.color,
marginRight: 1,
}}
/>
<Typography
sx={{
fontSize: "14px",
color: "#3d4551",
whiteSpace: "normal",
overflowWrap: "break-word",
maxWidth: "100px",
wordBreak: "break-word",
}}
>
{item.label}
</Typography>
<MuiTooltip title={item.label.length > 12 ? item.label : ""} arrow placement="top">
<Typography
sx={{
fontSize: "11px",
color: "#1B2631",
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
maxWidth: "88px",
fontFamily: "Inter"
}}
>
{item.label}
</Typography>
</MuiTooltip>
</Grid>
))}
</Grid>
Expand Down
Loading