- ))}
+ {Intl.NumberFormat('en-US', {
+ notation: 'compact',
+ maximumFractionDigits: 1,
+ }).format(povertyValue)}
- )}
-
-
- );
+
+
+ );
+ }
+
+ return ;
}
export default Poverty;
diff --git a/client/src/components/indicatorComponents/Under18.tsx b/client/src/components/indicatorComponents/Under18.tsx
index 09880434..da740cc8 100644
--- a/client/src/components/indicatorComponents/Under18.tsx
+++ b/client/src/components/indicatorComponents/Under18.tsx
@@ -12,44 +12,40 @@ type RevenueWidgetProps = {
};
function Under18({ city }: RevenueWidgetProps) {
- const [cityList, setCityList] = useState([]);
- const [under18s, setUnder18s] = useState(new Map());
- const [poverty, setPoverty] = useState(new Map());
const cityData = useData(`cities/${city}`);
- useEffect(() => {
- setCityList(cityData?.data);
- setUnder18s(cityData?.data.indicators.under18s);
- setPoverty(cityData?.data.indicators.persons_in_poverty);
- }, [cityData]);
+ if (cityData) {
+ const under18sList: { [key: number]: number } =
+ cityData?.data.indicators.under18s;
- return (
-
-
-
- Under 18s
-
-
- Number of persons under the age of 18
-
- {under18s !== undefined && (
+ const under18sValue =
+ Object.values(under18sList)[Object.values(under18sList).length - 1];
+
+ return (
+
+
+
+ Under 18s
+
+
+ Number of persons under the age of 18
+
- {Object.entries(under18s)
- .filter(([year, value]) => year === '2022')
- .map(([year, value]) => (
-
- {value}
-
- ))}
+ {Intl.NumberFormat('en-US', {
+ notation: 'compact',
+ maximumFractionDigits: 1,
+ }).format(under18sValue)}
- )}
-
-
- );
+
+
+ );
+ }
+
+ return ;
}
export default Under18;
From aba88f425beb60e868d4a3cb13f49a9cf026ae10 Mon Sep 17 00:00:00 2001
From: annabay04
Date: Wed, 12 Apr 2023 14:54:29 -0400
Subject: [PATCH 7/9] high school grads component
---
client/src/CityDashboard.tsx | 10 +---
.../HighSchoolGradsPercent.tsx | 51 +++++++++++++++++++
2 files changed, 53 insertions(+), 8 deletions(-)
create mode 100644 client/src/components/indicatorComponents/HighSchoolGradsPercent.tsx
diff --git a/client/src/CityDashboard.tsx b/client/src/CityDashboard.tsx
index e1c89175..3437d436 100644
--- a/client/src/CityDashboard.tsx
+++ b/client/src/CityDashboard.tsx
@@ -12,6 +12,7 @@ import ParticipantsWidget from './components/widgets/ParticipantsWidget';
import RevenueWidget from './components/widgets/RevenueWidget';
import CoachesWidget from './components/widgets/CoachesWidget';
import TotalChapters from './components/indicatorComponents/TotalChapters';
+import HighSchoolGradsPercent from './components/indicatorComponents/HighSchoolGradsPercent';
const heights = [150, 80, 90, 70, 110, 150, 130, 200, 60, 90, 150, 80, 90, 200];
@@ -52,14 +53,6 @@ function CityDashboard() {
-
-
-
-
-
-
-
-
+
{heights.map((height, ind) => (
add graph here: #{ind + 1}
diff --git a/client/src/components/indicatorComponents/HighSchoolGradsPercent.tsx b/client/src/components/indicatorComponents/HighSchoolGradsPercent.tsx
new file mode 100644
index 00000000..9aef37b3
--- /dev/null
+++ b/client/src/components/indicatorComponents/HighSchoolGradsPercent.tsx
@@ -0,0 +1,51 @@
+import React, { useEffect, useState } from 'react';
+import { Toolbar } from '@mui/material';
+import Box from '@mui/material/Box';
+import Paper from '@mui/material/Paper';
+import Typography from '@mui/material/Typography';
+import { useData } from '../../util/api';
+import ICity from '../../util/types/city';
+import COLORS from '../../assets/colors';
+
+type RevenueWidgetProps = {
+ city: string;
+};
+
+function HighSchoolGradsPercent({ city }: RevenueWidgetProps) {
+ const cityData = useData(`cities/${city}`);
+
+ if (cityData) {
+ const hsGraduateList: { [key: number]: number } =
+ cityData?.data.indicators.high_school_graduates;
+
+ const HSGraduateValue =
+ Object.values(hsGraduateList)[Object.values(hsGraduateList).length - 1];
+
+ return (
+
+
+
+ High School Graduates
+
+
+ High school graduate or higher, percent of persons age 25+
+
+
+ {Intl.NumberFormat('en-US', {
+ notation: 'compact',
+ maximumFractionDigits: 1,
+ }).format(HSGraduateValue)}
+
+
+
+ );
+ }
+
+ return ;
+}
+
+export default HighSchoolGradsPercent;
From 7a0e8ac12592a5a96425fa19b0b618344b2624aa Mon Sep 17 00:00:00 2001
From: Santiago Garcia Santos
Date: Sun, 16 Apr 2023 17:54:59 -0400
Subject: [PATCH 8/9] Update README.md
---
README.md | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index f6e50555..3e916891 100644
--- a/README.md
+++ b/README.md
@@ -1,33 +1,24 @@
-# Boilerplate
+# Beat The Streets - Dashboard
-This is a simple boilerplate designed to serve as robust template for quickly starting development on a [Typescript](https://www.typescriptlang.org) based [MERN](https://www.mongodb.com/mern-stack) web application.
+This is a project for [Beat the Streets](https://beatthestreets.org/) that aggregates and displays statistics and data points related to both current locations and target expansion locations. The goal is to provide an all-in-one platform where administrators can view the performance of individual locations as well as nation-wide impact. Furthermore, the platform will also allow them to view the most pertinent data on potential future locations, allowed them to make more informed decisions as the organisation grows.
-## Features
+This project was built using the MERN stack. Setup is outlined below.
-- Session based authentication with [Passport](https://www.passportjs.org)
-- Emailing for account verification and resetting password with [SendGrid](https://sendgrid.com)
-- Admin functionality for viewing/deleting/promoting other users
-- Clean authentication pages built with [Material UI](https://mui.com)
-- In memory database testing with [Jest](https://jestjs.io) and [Supertest](https://www.npmjs.com/package/supertest)
-- [AirBnb Typescript styling](https://github.com/airbnb/javascript) with [Prettier](https://prettier.io) and [ESLint](https://eslint.org)
-- [Husky](https://typicode.github.io/husky/#/) and [lint-staged](https://github.com/okonet/lint-staged) for checking linting on commits
-- [GitHub Actions](https://docs.github.com/en/actions) for ensuring linting + tests pass on pushes
+## Setup
-## Required tools
+### Required tools
These are necessary to build and run the project at full functionality
- Install [Yarn Package Manager](https://classic.yarnpkg.com/en/docs/install/#mac-stable)
- Install [NodeJS](https://nodejs.org/en/download/)
-## Recommended tools
+### Recommended tools
To take full advantage of the linting/formatting, recommend adding the [Prettier](https://prettier.io) and [ESLint](https://eslint.org) VSCode extensions and configuring them as shown [here](https://levelup.gitconnected.com/setting-up-eslint-with-prettier-typescript-and-visual-studio-code-d113bbec9857#:~:text=Install%20the%20following%20Visual%20Studio%20Code%20extensions) for code highlighting and formatting on save. Skip to the section labeled "Add the following to your VS Code settings.json". To access your settings.json, follow what is linked [here](https://stackoverflow.com/questions/65908987/how-can-i-open-visual-studio-codes-settings-json-file). See [here](https://blog.logrocket.com/using-prettier-eslint-automate-formatting-fixing-javascript/#differences-between-eslint-prettier) for the differences between the two tools and how they work together.
Finally, we also recommend downloading the [Live Share](https://visualstudio.microsoft.com/services/live-share/) extension by Microsoft for improved Collaboration. This allows for easy peer programming on one shared repository instance.
-## Setup
-
### MongoDB
The boilerplate uses [MongoDB](https://www.mongodb.com) as the database to store information for authentication. To have this available for use, do the following
From 72c8e87677c9b279cedb30c76a529242b3bbfdbd Mon Sep 17 00:00:00 2001
From: Santiago Garcia Santos
Date: Sun, 16 Apr 2023 17:58:37 -0400
Subject: [PATCH 9/9] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 3e916891..da3f1969 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# Beat The Streets - Dashboard
+
+
This is a project for [Beat the Streets](https://beatthestreets.org/) that aggregates and displays statistics and data points related to both current locations and target expansion locations. The goal is to provide an all-in-one platform where administrators can view the performance of individual locations as well as nation-wide impact. Furthermore, the platform will also allow them to view the most pertinent data on potential future locations, allowed them to make more informed decisions as the organisation grows.
This project was built using the MERN stack. Setup is outlined below.