{"id":31628189,"url":"https://github.com/cod-e-codes/tcalc","last_synced_at":"2026-04-20T14:02:10.567Z","repository":{"id":317784952,"uuid":"1068829857","full_name":"Cod-e-Codes/tcalc","owner":"Cod-e-Codes","description":"A terminal-based calculator with TUI interface, supporting basic and scientific modes, history, typing input, and mouse/keyboard button interaction.","archived":false,"fork":false,"pushed_at":"2025-10-06T14:51:09.000Z","size":3015,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-10T12:21:24.430Z","etag":null,"topics":["calculator","cli","command-line-app","crossterm","ratatui","rust","terminal","tui"],"latest_commit_sha":null,"homepage":"https://github.com/Cod-e-Codes/tcalc","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cod-e-Codes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-03T01:16:11.000Z","updated_at":"2025-10-06T14:51:13.000Z","dependencies_parsed_at":"2025-10-03T03:35:52.410Z","dependency_job_id":"0d2661bc-b0f9-446f-b489-1a1277df2260","html_url":"https://github.com/Cod-e-Codes/tcalc","commit_stats":null,"previous_names":["cod-e-codes/tcalc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cod-e-Codes/tcalc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Ftcalc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Ftcalc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Ftcalc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Ftcalc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cod-e-Codes","download_url":"https://codeload.github.com/Cod-e-Codes/tcalc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cod-e-Codes%2Ftcalc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32050451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calculator","cli","command-line-app","crossterm","ratatui","rust","terminal","tui"],"created_at":"2025-10-06T20:19:36.024Z","updated_at":"2026-04-20T14:02:10.547Z","avatar_url":"https://github.com/Cod-e-Codes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tcalc\n\nA terminal-based calculator with TUI interface built in Rust.\n\n![Demo](tcalc.gif)\n\n## Features\n\n- **Dual Modes**: Basic and Scientific calculator modes\n- **Interactive UI**: Button navigation with keyboard and mouse support\n- **Typing Mode**: Direct expression input with live evaluation\n- **Functions \u0026 Constants**: Type `sin`, `cos`, `tan`, `log`, `ln`, `sqrt`, `exp`, `abs`, and use `pi`/`π`, `e` in expressions\n- **Calculation History**: View and recall previous calculations\n- **Function Graphing**: Visualize mathematical expressions\n- **Secondary Functions**: Access variables and constants via 2nd function key\n- **Professional Interface**: Clean, color-coded button layout\n\n## Controls\n\n### Navigation\n- `↑↓←→` - Navigate buttons\n- `Enter`/`Space` - Press selected button\n- Mouse click - Press button directly\n\n### Modes\n- `` ` `` - Toggle typing mode\n- `m` - Switch between Basic/Scientific modes\n- `h` - Toggle calculation history\n- `2` - Toggle 2nd function mode from the keyboard\n- `2nd` - Access secondary functions (variables, constants) via button\n\n### Operations\n- `c` - Clear current expression\n- `C` - Clear all (expression and history)\n- `⌫` - Backspace\n- `r`/`Enter`/`Space` - Recall selected entry (when in history view; returns to calculator with expression)\n- `Ctrl+g` - Graph current expression\n- `?` - Show help modal\n  \nIn Typing mode, you can enter scientific functions and constants directly, e.g. `sin(pi/2)`, `cos(0)`, `ln(e)`, `sqrt(2)`, `exp(1)`, `abs(-3.5)`. In button mode, starting with a leading minus is supported via the `−` button.\n\nNote on Typing mode behavior:\n- Letters and digits are treated as literal input (build identifiers like `sin`, variables like `x`).\n- `2` does not toggle 2nd mode in Typing (use the `2nd` button or exit Typing).\n- `c`/`C` do not clear in Typing; use the clear buttons or exit Typing to clear.\n- `r` does not recall from history in Typing; it types the letter `r`.\n\nNotes on History behavior:\n- Newest entries appear at the top.\n- Recalling an entry exits History and restores the original expression for editing.\n\n### Graphing\n- `↑↓←→` - Pan graph view\n- `+/-` - Zoom in/out\n- `r` - Reset view to default range\n- `c` - Toggle coordinate display\n- `Esc` - Exit graph mode\n\nYou can graph expressions that include variables and functions, e.g. `sin(x)`, `cos(x) + 0.5`, `ln(x)`, `sqrt(x^2 + 1)`. Mouse position updates the displayed coordinates within the drawn graph area.\n\n### Exit\n- `q` or `Esc` - Quit application\n\n## Installation\n\n```bash\ngit clone \u003crepository-url\u003e\ncd tcalc\ncargo build --release\n./target/release/tcalc\n```\n\n## Dependencies\n\n- `anyhow` - Error handling\n- `chrono` - Timestamp formatting\n- `crossterm` - Terminal control\n- `ratatui` - TUI framework\n\n## Usage\n\nRun the application and use keyboard navigation or mouse clicks to interact with the calculator buttons. \n\n### Basic Operations\nSwitch to typing mode for direct expression input, or use button navigation for traditional calculator operation.\n\n### Graphing Functions\n1. Build an expression using variables (x, y, z, a, b, c) and constants (π, e)\n2. Press `Ctrl+g` (always available) or use the Graph button in 2nd function mode\n3. Use arrow keys to pan, +/- to zoom, and `r` to reset the view\n\n### Variables and Constants\n- **Variables**: x, y, z, a, b, c (available in 2nd function mode)\n- **Constants**: `pi`/`π` (3.14159), `e` (2.71828)\n- **Scientific functions**: `sin`, `cos`, `tan`, `log`, `ln`, `sqrt`, `exp`, `abs` (typeable in Typing mode; available as buttons in Scientific mode)\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcod-e-codes%2Ftcalc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcod-e-codes%2Ftcalc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcod-e-codes%2Ftcalc/lists"}