├── .prettierrc.json ├── .gitignore ├── .prettierignore ├── site ├── .npmrc ├── src │ ├── react-app-env.d.ts │ ├── home │ │ ├── home.css │ │ ├── growth.svg │ │ ├── table.svg │ │ ├── trend.svg │ │ ├── speaker.svg │ │ └── index.tsx │ ├── word-counts │ │ ├── index.css │ │ ├── getWordCounts.test.ts │ │ ├── getWordCounts.ts │ │ └── index.tsx │ ├── search-trends │ │ ├── SearchTips.css │ │ ├── emptySearch.tsx │ │ ├── getSnippetFromResults.test.tsx │ │ ├── SearchTips.tsx │ │ ├── searchBar.tsx │ │ ├── getSnippetFromResults.tsx │ │ ├── getTrendData.tsx │ │ ├── __snapshots__ │ │ │ └── getSnippetFromResults.test.tsx.snap │ │ ├── getTrendData.test.tsx │ │ ├── SearchResultsTable.tsx │ │ └── index.tsx │ ├── index.css │ ├── header │ │ ├── index.css │ │ └── index.tsx │ ├── setupTests.ts │ ├── shared │ │ ├── filters.css │ │ ├── crunching.tsx │ │ ├── useIsSmallScreen.ts │ │ ├── getChartOptions.tsx │ │ ├── useParameters.ts │ │ ├── filters.test.tsx │ │ ├── filters.tsx │ │ └── data.ts │ ├── usePageTracking.ts │ ├── loading.tsx │ ├── footer │ │ └── index.tsx │ ├── commonChartConfig.ts │ ├── layout.tsx │ ├── vocabulary-size │ │ ├── getVocabularySize.test.ts │ │ ├── getVocabularySize.ts │ │ └── index.tsx │ ├── growth │ │ └── index.tsx │ ├── index.tsx │ └── methodology │ │ └── index.tsx ├── public │ ├── robots.txt │ ├── favicon.ico │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ ├── index.html │ └── logo.svg ├── tsconfig.paths.json ├── craco.config.js ├── .gitignore ├── tsconfig.json ├── package.json └── README.md ├── case2 ├── constants.js ├── index.js ├── filterValidTalks.js ├── getTalks.test.js ├── getTalks.js └── fixtures │ ├── 17kacher_out.txt │ ├── 55soares_out.txt │ └── 55soares.html ├── README.md ├── package.json ├── .github └── workflows │ └── deploy-pages.yml ├── jest.config.mjs └── case1 ├── index.js └── output ├── keyCollections.json └── stats.json /.prettierrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /site/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org -------------------------------------------------------------------------------- /site/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /site/src/home/home.css: -------------------------------------------------------------------------------- 1 | .home-button:hover { 2 | background-color: #f7f2f2; 3 | } -------------------------------------------------------------------------------- /case2/constants.js: -------------------------------------------------------------------------------- 1 | export const BASE_URL = "https://www.churchofjesuschrist.org"; 2 | -------------------------------------------------------------------------------- /site/src/word-counts/index.css: -------------------------------------------------------------------------------- 1 | .stop-words { 2 | color: gray; 3 | font-size: x-small; 4 | } -------------------------------------------------------------------------------- /site/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /site/src/search-trends/SearchTips.css: -------------------------------------------------------------------------------- 1 | .searchTips [role="dialog"] { 2 | width: 400px !important; 3 | } -------------------------------------------------------------------------------- /site/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgood92/general-conference-stats/HEAD/site/public/favicon.ico -------------------------------------------------------------------------------- /site/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgood92/general-conference-stats/HEAD/site/public/logo192.png -------------------------------------------------------------------------------- /site/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgood92/general-conference-stats/HEAD/site/public/logo512.png -------------------------------------------------------------------------------- /site/src/index.css: -------------------------------------------------------------------------------- 1 | html, 2 | body, 3 | #root { 4 | margin: 0; 5 | height: 100%; 6 | } 7 | .white { 8 | background-color: white !important; 9 | } -------------------------------------------------------------------------------- /site/tsconfig.paths.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "@root/*": ["../*"] 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # General Conference Stats 2 | 3 | Please see [this site](https://cgood92.github.io/general-conference-stats) for more information. 4 | 5 | PRs, issues, and feedback welcome! -------------------------------------------------------------------------------- /site/src/header/index.css: -------------------------------------------------------------------------------- 1 | a:not(:first-of-type).active { 2 | font-weight: bold; 3 | text-decoration: none !important; 4 | color: #222 !important; 5 | } 6 | a { 7 | text-align: center; 8 | } -------------------------------------------------------------------------------- /site/craco.config.js: -------------------------------------------------------------------------------- 1 | const { CracoAliasPlugin } = require("react-app-alias-ex"); 2 | 3 | module.exports = { 4 | plugins: [ 5 | { 6 | plugin: CracoAliasPlugin, 7 | options: {}, 8 | }, 9 | ], 10 | }; 11 | -------------------------------------------------------------------------------- /site/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /case2/index.js: -------------------------------------------------------------------------------- 1 | import getTalks from "./getTalks.js"; 2 | 3 | async function run() { 4 | for (let year = 1971; year <= 2024; year++) { 5 | console.info("\n\nRunning year ", year); 6 | await getTalks(year, "04"); 7 | await getTalks(year, "10"); 8 | } 9 | } 10 | 11 | run(); 12 | -------------------------------------------------------------------------------- /site/src/shared/filters.css: -------------------------------------------------------------------------------- 1 | .indicator { 2 | border-radius: 9999px; 3 | top: 0px; 4 | left: 0.25rem; 5 | border-style: solid; 6 | border-width: 1px; 7 | border-color: rgba(255, 255, 255, 1); 8 | background-color: rgba(20, 115, 230, 1); 9 | width: 0.625rem; 10 | height: 0.625rem; 11 | position: absolute; 12 | } -------------------------------------------------------------------------------- /site/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /site/src/usePageTracking.ts: -------------------------------------------------------------------------------- 1 | import { useEffect } from "react"; 2 | import { useLocation } from "react-router-dom"; 3 | 4 | declare global { 5 | interface Window { 6 | gtag: any; 7 | } 8 | } 9 | 10 | export default function usePageTracking() { 11 | const location = useLocation(); 12 | 13 | useEffect(() => { 14 | window.gtag("event", "page_view", { 15 | page_location: location.pathname + location.search, 16 | }); 17 | }, [location.pathname, location.search]); 18 | } 19 | -------------------------------------------------------------------------------- /site/src/shared/crunching.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Flex, ProgressCircle, Text } from "@adobe/react-spectrum"; 3 | 4 | export default function Crunching() { 5 | return ( 6 | 7 | 12 | Crunching the numbers... 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /site/src/home/growth.svg: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /site/src/search-trends/emptySearch.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Content, Heading, IllustratedMessage } from "@adobe/react-spectrum"; 3 | import NoSearchResults from "@spectrum-icons/illustrations/NoSearchResults"; 4 | 5 | export default function EmptySearch() { 6 | return ( 7 | 8 | 9 | Nothing to search for 10 | Go ahead, search something else, it'll be fun! 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "general-conference-stats", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "type": "module", 6 | "scripts": { 7 | "case1": "node ./case1/index.js", 8 | "case2": "node ./case2/index.js", 9 | "case2:web": "node ./case2/buildWeb.js", 10 | "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js" 11 | }, 12 | "devDependencies": { 13 | "jest": "29.4.2", 14 | "jsdom": "^20.0.3", 15 | "node-fetch": "^3.3.0", 16 | "prettier": "2.8.3", 17 | "string-strip-html": "8.4.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /site/src/loading.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { ProgressCircle } from "@adobe/react-spectrum"; 3 | 4 | export default function Loading() { 5 | return ( 6 |
7 | 12 |

Loading lots of cool data...

13 |
14 | ); 15 | } 16 | 17 | const style: React.CSSProperties = { 18 | height: "100%", 19 | width: "100%", 20 | display: "flex", 21 | alignItems: "center", 22 | justifyContent: "center", 23 | flexDirection: "column", 24 | }; -------------------------------------------------------------------------------- /site/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "General Conference Analytics", 3 | "name": "General Conference Analytics", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /site/src/footer/index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Link, View } from "@adobe/react-spectrum"; 3 | 4 | export default function Footer() { 5 | return ( 6 | 14 | Open source project on{" "} 15 | 16 | 21 | GitHub 22 | 23 | 24 | 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /site/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.paths.json", 3 | "compilerOptions": { 4 | "target": "es5", 5 | "lib": [ 6 | "dom", 7 | "dom.iterable", 8 | "esnext" 9 | ], 10 | "allowJs": true, 11 | "skipLibCheck": true, 12 | "esModuleInterop": true, 13 | "allowSyntheticDefaultImports": true, 14 | "strict": true, 15 | "forceConsistentCasingInFileNames": true, 16 | "noFallthroughCasesInSwitch": true, 17 | "module": "esnext", 18 | "moduleResolution": "node", 19 | "resolveJsonModule": true, 20 | "isolatedModules": true, 21 | "noEmit": true, 22 | "jsx": "react-jsx" 23 | }, 24 | "include": [ 25 | "src" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /site/src/shared/useIsSmallScreen.ts: -------------------------------------------------------------------------------- 1 | import { useProvider } from "@adobe/react-spectrum"; 2 | import { useEffect, useState } from "react"; 3 | 4 | export default function useIsSmallScreen() { 5 | const provider = useProvider(); 6 | const [isSmall, setIsSmall] = useState( 7 | () => window.innerWidth <= provider.breakpoints.S! 8 | ); 9 | 10 | useEffect(() => { 11 | function updateDimensions() { 12 | setIsSmall(window.innerWidth <= provider.breakpoints.S!); 13 | } 14 | 15 | window.addEventListener("resize", updateDimensions); 16 | 17 | return () => window.removeEventListener("resize", updateDimensions); 18 | }, [provider.breakpoints.S]); 19 | 20 | return isSmall; 21 | } 22 | -------------------------------------------------------------------------------- /site/src/commonChartConfig.ts: -------------------------------------------------------------------------------- 1 | const config = { 2 | chart: { 3 | height: 350, 4 | dropShadow: { 5 | enabled: true, 6 | color: "#000", 7 | top: 18, 8 | left: 7, 9 | blur: 10, 10 | opacity: 0.2, 11 | }, 12 | toolbar: { 13 | show: true, 14 | }, 15 | }, 16 | grid: { 17 | borderColor: "#e7e7e7", 18 | row: { 19 | colors: ["#f3f3f3", "transparent"], // takes an array which will be repeated on columns 20 | opacity: 0.5, 21 | }, 22 | }, 23 | markers: { 24 | size: 0.5, 25 | }, 26 | yaxis: { 27 | labels: { 28 | formatter: (value: number) => Number(value).toLocaleString(), 29 | }, 30 | }, 31 | }; 32 | 33 | export default config; 34 | -------------------------------------------------------------------------------- /site/src/search-trends/getSnippetFromResults.test.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import renderer from "react-test-renderer"; 3 | import talks_1973_10 from "@root/case2/output/1973-10.json"; 4 | 5 | import getSnippetFromResults from "./getSnippetFromResults"; 6 | 7 | type Results = RegExpMatchArray[]; 8 | 9 | const Example = ({ results }: { results: Results }) => 10 | getSnippetFromResults(results); 11 | 12 | const text = talks_1973_10[0].content; 13 | 14 | describe("creates a logical snippet for the results", () => { 15 | it("case 1", () => { 16 | const results: Results = Array.from(text.matchAll(/ment/gi)); 17 | 18 | expect( 19 | renderer.create().toJSON() 20 | ).toMatchSnapshot(); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /site/src/shared/getChartOptions.tsx: -------------------------------------------------------------------------------- 1 | import commonChartConfig from "../commonChartConfig"; 2 | import { numberToConferenceName } from "./filters"; 3 | 4 | type options = { 5 | searchTerms: Array; 6 | yearsArray: Array; 7 | }; 8 | 9 | export function getChartOptions({ searchTerms, yearsArray }: options) { 10 | return { 11 | ...commonChartConfig, 12 | dataLabels: { 13 | enabled: true, 14 | }, 15 | title: { 16 | text: `Use of ${searchTerms 17 | .map((term) => `"${term}"`) 18 | .join(", ")} over time`, 19 | }, 20 | xaxis: { 21 | categories: yearsArray.map(numberToConferenceName), 22 | }, 23 | yaxis: { 24 | title: { 25 | text: "Count", 26 | }, 27 | }, 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /site/src/layout.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { defaultTheme, Flex, Provider, View } from "@adobe/react-spectrum"; 3 | import Footer from "./footer"; 4 | import Header from "./header"; 5 | 6 | type LayoutProps = { 7 | children: any; 8 | }; 9 | 10 | export default function Layout({ children }: LayoutProps) { 11 | return ( 12 | 13 | 14 |
15 | 26 | {children} 27 | 28 |