Sign inSign up

c2stack/cc-math

By c2stack

โ€ขUpdated 7 months ago

Image
0

919

c2stack/cc-math repository overview

โ CC Math Tools

A modern, browser-based collection of math and statistics utilities. The app currently includes a Cohen's Kappa calculator for 2x2 contingency tables, with step-by-step formula display.

โ โœจ Features

  • Cohen's Kappa Calculator: Compute agreement beyond chance from a 2x2 table
  • Live Calculations: Row/column totals and derived values update instantly
  • Formula Breakdown: Displays $p_0$, $p_e$, and $\kappa$ formulas with rendered math
  • Input Validation: Numeric inputs are clamped to non-negative integers
  • Theme Support: Light, dark, and auto (system) theme modes
  • Responsive Layout: Works across desktop and mobile browsers

โ ๐Ÿš€ Getting Started

โ Prerequisites
โ Installation
  1. Navigate to the app directory:
cd apps/cc-math
  1. Install dependencies:
bun install
โ Development

Run the development server:

bun dev

The app runs on http://localhost:3000.

โ ๐Ÿ—๏ธ Building For Production

Build the application:

bun build

Preview the production build:

bun preview

โ ๐Ÿ“– Usage

โ Cohen's Kappa (2x2)
  1. Open the Kappa Statistic tool route
  2. Enter counts for all four cells: $a$, $b$, $c$, and $d$
  3. Review computed row/column totals and $N$
  4. Inspect calculated values:
    • Observed agreement: $p_0 = \frac{a+d}{N}$
    • Expected agreement: $p_e = \frac{(r_1c_1)+(r_2c_2)}{N^2}$
    • Kappa: $\kappa = \frac{p_0-p_e}{1-p_e}$
โ Notes
  • Inputs are treated as non-negative integers
  • If a value is undefined (for example, division by zero), the UI shows an undefined result

โ ๐Ÿงช Testing

Run tests with:

bun test

This project uses Vitestโ  for testing.

โ ๐Ÿ› ๏ธ Tech Stack

โ ๐Ÿ“ Project Structure

cc-math/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ””โ”€โ”€ ThemeToggle.tsx          # Theme mode switcher
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ __root.tsx               # Root document and app shell
โ”‚   โ”‚   โ”œโ”€โ”€ index.tsx                # Home route (currently minimal)
โ”‚   โ”‚   โ””โ”€โ”€ kappa-statistic.tsx      # Cohen's Kappa calculator
โ”‚   โ”œโ”€โ”€ router.tsx                   # Router setup
โ”‚   โ”œโ”€โ”€ main.tsx                     # App entry point
โ”‚   โ””โ”€โ”€ styles.css                   # Global styles
โ”œโ”€โ”€ public/                          # Static assets
โ””โ”€โ”€ Dockerfile                       # Container build recipe

โ ๐Ÿณ Docker

Build and run from the monorepo root:

docker build -t cc-math -f apps/cc-math/Dockerfile .
docker run -p 8080:80 cc-math

โ ๐Ÿค Contributing

This app is part of the cc-web-tools monorepo. Follow the root repository contribution workflow.

โ ๐Ÿ“„ License

Part of the cc-web-tools project.

Tag summary

Content type

Image

Digest

sha256:e770df406โ€ฆ

Size

25.8 MB

Last updated

7 months ago

docker pull c2stack/cc-math