diff --git a/data/coop.ts b/data/coop.ts new file mode 100644 index 0000000..11f1741 --- /dev/null +++ b/data/coop.ts @@ -0,0 +1,589 @@ +export const C1 = [ + { + category: "Coop", + value: 100, + }, + { + category: "Regular", + value: 0, + }, +]; + +export const C2 = [ + { + text: "Toronto", + value: 32, + }, + { + text: "California", + value: 26, + }, + { + text: "West CA", + value: 12, + }, + { + text: "East USA", + value: 11, + }, + { + text: "Waterloo", + value: 9, + }, +]; + +export const C3 = [ + { + category: "Yes", + value: 17, + }, + { + category: "No", + value: 83, + }, +]; + +export const C4 = [ + { + text: "Google", + value: 14, + }, + { + text: "Jane Street", + value: 8, + }, + { + text: "Meta/Facebook", + value: 4, + }, + { + text: "Databricks", + value: 3, + }, + { + text: "HRT", + value: 2, + }, + { + text: "Cisco Meraki", + value: 2, + }, + { + text: "Apple", + value: 2, + }, + { + text: "Datadog", + value: 2, + }, + { + text: "Shopify", + value: 2, + }, + { + text: "Stripe", + value: 1, + }, + { + text: "Citadel", + value: 1, + }, + { + text: "Faire", + value: 1, + }, + { + text: "Square", + value: 1, + }, + { + text: "Salesforce", + value: 1, + }, + { + text: "Capital One", + value: 1, + }, +]; + +export const C5 = [ + { + category: "Yes", + value: 6, + }, + { + category: "No", + value: 94, + }, +]; + +export const C6 = [ + { + category: "0", + value: 92, + }, + { + category: "1", + value: 8, + }, +]; + +export const C7i = [ + { + text: "Google", + value: 2, + }, + { + text: "Konrad", + value: 1, + }, + { + text: "Jane Street", + value: 2, + }, + { + text: "Meta/Facebook", + value: 2, + }, + { + text: "Microsoft", + value: 2, + }, + { + text: "Databricks", + value: 1, + }, + { + text: "HRT", + value: 2, + }, + { + text: "Asana", + value: 1, + }, + { + text: "Bloomberg", + value: 1, + }, + { + text: "SAP", + value: 1, + }, + { + text: "Cisco Meraki", + value: 1, + }, + { + text: "Apple", + value: 1, + }, + { + text: "Datadog", + value: 1, + }, + { + text: "Shopify", + value: 1, + }, + { + text: "Stripe", + value: 1, + }, + { + text: "Citadel", + value: 1, + }, + { + text: "Faire", + value: 1, + }, + { + text: "Square", + value: 1, + }, + { + text: "Salesforce", + value: 1, + }, + { + text: "Capital One", + value: 1, + }, + { + text: "Wish", + value: 1, + }, + { + text: "Thomson Reuters", + value: 1, + }, + { + text: "Uber", + value: 1, + }, + { + text: "Rippling", + value: 1, + }, + { + text: "Intel", + value: 1, + }, + { + text: "NVIDIA", + value: 1, + }, + { + text: "Twitch", + value: 1, + }, + { + text: "RBC", + value: 1, + }, + { + text: "Huawei", + value: 1, + }, + { + text: "LinkedIn", + value: 1, + }, + { + text: "Lyft", + value: 1, + }, + { + text: "1Password", + value: 1, + }, + { + text: "IBM", + value: 1, + }, + { + text: "Snowflake", + value: 1, + }, + { + text: "Autodesk", + value: 1, + }, + { + text: "Tableau", + value: 1, + }, + { + text: "Yugabyte", + value: 1, + }, + { + text: "Twitter", + value: 1, + }, + { + text: "Tesla", + value: 1, + }, + { + text: "Coursera", + value: 1, + }, + { + text: "EA", + value: 1, + }, +]; + +export const C7ii = { + xValues: ["1", "2", "3", "4", "5", "6"], + lines: [ + { + label: "Waterloo", + yValues: [22.1, 18.1, 16.9, 2.6, 1.3, 3.6], + }, + { + label: "Toronto", + yValues: [50.2, 48.2, 30.4, 7, 4, 3.6], + }, + { + label: "Remote", + yValues: [7.4, 4.8, 4.8, 82.1, 80.5, 73.2], + }, + { + label: "USA(California, Washington, New York)", + yValues: [8.4, 18.1, 35, 0, 5.2, 17.9], + }, + ], +}; + +export const C7iii = [ + { + category: "1", + min: 14, + firstQuartile: 18, + median: 22, + thirdQuartile: 40, + max: 50, + outliers: [105, 147], + }, + { + category: "2", + min: 17.5, + firstQuartile: 22, + median: 25, + thirdQuartile: 36, + max: 76, + outliers: [105], + }, + { + category: "3", + min: 16, + firstQuartile: 26, + median: 33, + thirdQuartile: 55, + max: 95, + outliers: [130], + }, + { + category: "4", + min: 16, + firstQuartile: 30, + median: 35, + thirdQuartile: 60, + max: 140, + outliers: [], + }, + { + category: "5", + min: 26, + firstQuartile: 39, + median: 44, + thirdQuartile: 60, + max: 145, + outliers: [], + }, + { + category: "6", + min: 24, + firstQuartile: 40, + median: 48, + thirdQuartile: 72, + max: 132, + outliers: [], + }, +]; + +export const C7iv = [ + { + category: "1", + min: 0, + firstQuartile: 0, + median: 0, + thirdQuartile: 300, + max: 4000, + outliers: [10000], + }, + { + category: "2", + min: 0, + firstQuartile: 0, + median: 0, + thirdQuartile: 2000, + max: 14000, + outliers: [], + }, + { + category: "3", + min: 0, + firstQuartile: 0, + median: 250, + thirdQuartile: 10000, + max: 20500, + outliers: [], + }, + { + category: "4", + min: 0, + firstQuartile: 0, + median: 0, + thirdQuartile: 4000, + max: 12000, + outliers: [], + }, + { + category: "5", + min: 0, + firstQuartile: 0, + median: 1250, + thirdQuartile: 8000, + max: 20000, + outliers: [], + }, + { + category: "6", + min: 0, + firstQuartile: 0, + median: 1000, + thirdQuartile: 15000, + max: 30493, + outliers: [], + }, +]; + +export const C7vKey = ["Outstanding", "Excellent", "Very Good", "Good"]; + +export const C7v = [ + { + category: "1", + Outstanding: 48.9, + Excellent: 33.7, + "Very Good": 10.9, + Good: 4.3, + }, + { + category: "2", + Outstanding: 44.6, + Excellent: 48.2, + "Very Good": 4.8, + Good: 1.2, + }, + { + category: "3", + Outstanding: 54.9, + Excellent: 35.4, + "Very Good": 8.5, + Good: 0, + }, + { + category: "4", + Outstanding: 49.4, + Excellent: 39.2, + "Very Good": 3.8, + Good: 0, + }, + { + category: "5", + Outstanding: 54.9, + Excellent: 35.4, + "Very Good": 8.5, + Good: 0, + }, + { + category: "6", + Outstanding: 30.4, + Excellent: 30.4, + "Very Good": 10.7, + Good: 3.6, + }, +]; + +export const C7viKey = ["5", "4", "3", "2", "1"]; + +export const C7vi = [ + { + category: "1", + 5: 41.3, + 4: 26.1, + 3: 20.7, + 2: 8.7, + 1: 3.3, + }, + { + category: "2", + 5: 37.8, + 4: 36.6, + 3: 14.6, + 2: 9.8, + 1: 1.2, + }, + { + category: "3", + 5: 39.5, + 4: 40.7, + 3: 11.1, + 2: 4.9, + 1: 3.7, + }, + { + category: "4", + 5: 33.8, + 4: 37.7, + 3: 18.2, + 2: 9.1, + 1: 1.3, + }, + { + category: "5", + 5: 51.9, + 4: 32.5, + 3: 14.3, + 2: 1.3, + 1: 0, + }, + { + category: "6", + 5: 53.7, + 4: 20.4, + 3: 18.5, + 2: 5.6, + 1: 1.9, + }, +]; + +export const C7vii = { + xValues: ["1", "2", "3", "4", "5", "6"], + lines: [ + { + label: "Main rounds", + yValues: [66.7, 61.4, 62.2, 49.4, 52.6, 46.4], + }, + { + label: "Continuous Rounds", + yValues: [20.4, 16.9, 13.4, 7.6, 1.3, 1.8], + }, + { + label: "Externally", + yValues: [12.9, 16.9, 20.7, 35.4, 32.9, 39.3], + }, + { + label: "Return", + yValues: [0, 4.8, 3.7, 7.8, 11.8, 12.5], + }, + ], +}; + +export const C7viiiKey = ["No", "Yes"]; + +export const C7viii = [ + { + category: "1", + Yes: 16.3, + No: 83.7, + }, + { + category: "2", + Yes: 6.1, + No: 93.9, + }, + { + category: "3", + Yes: 8.5, + No: 91.5, + }, + { + category: "4", + Yes: 7.7, + No: 92.3, + }, + { + category: "5", + Yes: 9.1, + No: 90.9, + }, + { + category: "6", + Yes: 5.5, + No: 94.5, + }, +]; diff --git a/pages/coop.tsx b/pages/coop.tsx new file mode 100644 index 0000000..39f751f --- /dev/null +++ b/pages/coop.tsx @@ -0,0 +1,310 @@ +import { + C1, + C2, + C3, + C4, + C5, + C6, + C7i, + C7ii, + C7iii, + C7iv, + C7v, + C7vKey, + C7vi, + C7viKey, + C7vii, + C7viii, + C7viiiKey, +} from "data/coop"; +import { pageRoutes } from "data/routes"; +import React from "react"; +import { Color } from "utils/Color"; +import { DefaultProp, pieChartProps, wordCloudWidth } from "utils/defaultProps"; +import { useWindowDimensions } from "utils/getWindowDimensions"; +import { useIsMobile } from "utils/isMobile"; + +import { BottomNav } from "@/components/BottomNav"; +import { BoxPlot } from "@/components/Boxplot"; +import { ComponentWrapper } from "@/components/ComponentWrapper"; +import { Header } from "@/components/Header"; +import { LineGraph } from "@/components/LineGraph"; +import { PieChart } from "@/components/PieChart"; +import { SectionHeader } from "@/components/SectionHeader"; +import { + StackedBarGraphHorizontal, + StackedBarGraphVertical, +} from "@/components/StackedBarGraph"; + +import { WordCloud } from "../components/WordCloud"; + +import styles from "./samplePage.module.css"; + +export default function CoopPage() { + const pageWidth = useWindowDimensions().width; + const isMobile = useIsMobile(); + + const colorRange = [ + Color.primaryAccent, + Color.secondaryAccentLight, + Color.primaryAccentLight, + Color.secondaryAccent, + ]; + + return ( +
+
+ + {/* C1 */} + +
+ +
+
+ + {/* C7ii */} + + + + + {/* C2 */} + + + + + {/* C7i */} + + + + + {/* c4 */} + + + + + {/* c3 */} + +
+ +
+
+ + {/* c5 */} + +
+ +
+
+ + {/* c6 */} + +
+ +
+
+ + {/* C7iii */} + + + + + {/* C7iv */} + + + + + {/* C7v */} + +
+ +
+
+ + {/* C7vi */} + +
+ +
+
+ + {/* C7vii */} + +
+ +
+
+ + {/* C7viii */} + +
+ +
+
+ + +
+ ); +} diff --git a/pages/demographics.tsx b/pages/demographics.tsx index b365e08..8bc8117 100644 --- a/pages/demographics.tsx +++ b/pages/demographics.tsx @@ -19,6 +19,7 @@ import { pieChartProps, barGraphMargin, barGraphWidth, + wordCloudWidth, } from "utils/defaultProps"; import { useWindowDimensions } from "utils/getWindowDimensions"; import { useIsMobile } from "utils/isMobile"; @@ -107,7 +108,7 @@ export default function Demographics() { > + isMobile + ? pageWidth / mobileBarGraphFactor + : pageWidth / desktopBarGraphFactor; const mobilePieChartFactor = 1.25; const desktopPieChartFactor = 3; +export const pieChartWidth = (isMobile: boolean, pageWidth: number) => + isMobile + ? pageWidth / mobilePieChartFactor + : pageWidth / desktopPieChartFactor; -const graphWidth = ( - isMobile: boolean, - pageWidth: number, - isPieChart: boolean -): number => { - const mobileFactor = isPieChart ? mobilePieChartFactor : mobileBarGraphFactor; - const desktopFactor = isPieChart - ? desktopPieChartFactor - : desktopBarGraphFactor; - return isMobile ? pageWidth / mobileFactor : pageWidth / desktopFactor; -}; - -export const barGraphWidth = (isMobile: boolean, width: number) => - graphWidth(isMobile, width, false); - -export const pieChartWidth = (isMobile: boolean, width: number) => - graphWidth(isMobile, width, true); +const desktopWordCloudFactor = 1.5; +const mobileWordCloudWidth = 800; +export const wordCloudWidth = (isMobile: boolean, pageWidth: number) => + isMobile ? pageWidth / desktopWordCloudFactor : mobileWordCloudWidth; export const barGraphMargin = { top: 20, @@ -34,7 +29,6 @@ export const barGraphMargin = { left: 60, right: 20, }; - export const DefaultProp: { [key in PropName]: number } = { graphHeight: 500, labelSize: 24,