{"id":25954120,"url":"https://github.com/bratpeki/grap.h","last_synced_at":"2025-07-11T18:13:46.002Z","repository":{"id":110849658,"uuid":"419440667","full_name":"bratpeki/grap.h","owner":"bratpeki","description":"A single-header text-based graphing library written in ANSI C","archived":false,"fork":false,"pushed_at":"2024-01-15T12:18:19.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-15T15:48:33.466Z","etag":null,"topics":["c","graph","library","terminal"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bratpeki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-10-20T18:11:55.000Z","updated_at":"2024-01-15T12:18:40.000Z","dependencies_parsed_at":"2024-01-15T13:45:59.751Z","dependency_job_id":"63c32aec-8fca-46aa-b9e2-caad9473038d","html_url":"https://github.com/bratpeki/grap.h","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bratpeki%2Fgrap.h","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bratpeki%2Fgrap.h/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bratpeki%2Fgrap.h/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bratpeki%2Fgrap.h/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bratpeki","download_url":"https://codeload.github.com/bratpeki/grap.h/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241877445,"owners_count":20035403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["c","graph","library","terminal"],"created_at":"2025-03-04T15:49:11.385Z","updated_at":"2025-03-04T15:49:11.789Z","avatar_url":"https://github.com/bratpeki.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A single-header text-based graphing library written in ANSI C\n\n## Repo tree\n\n```\n.\n├── ex\n│   ├── cub.c\n│   ├── lin.c\n│   └── sqr.c\n├── Makefile\n├── README.md\n└── src\n    └── grap.h\n```\n\n## What is it?\n\n`grap.h` is an ANSI C single-header library for function graphing in the terminal.\n\n## How does it work?\n\nBelow are the results of compiling the code examples from `ex` and running the output files.\n\n### Linear function\n\n```\n$ make lin; ./lin\nLinear function: y = -2*x + (3)\nx.....................^......................\n.xx...................|......................\n...xx.................|......................\n....xxx...............|......................\n......xxx.............|......................\n........xxx...........|......................\n..........xx..........|......................\n............xxx.......|......................\n..............xx......|......................\n................xx....|......................\n..................xx..|......................\n...................xxx|......................\n----------------------xxx-------------------\u003e\n......................|.xxx..................\n......................|...xxx................\n......................|.....xx...............\n......................|.......xx.............\n......................|.........xx...........\n......................|...........xx.........\n......................|.............xx.......\n......................|..............xxx.....\n......................|.................xx...\n......................|..................xxx.\n......................|....................x.\n......................|......................\n```\n\n### Square function\n\n```\n$ make sqr; ./sqr\nSquare function: y=x^2\nx.....................^......................\n.x....................|....................x.\n..x...................|...................x..\n...x..................|..................x...\n....x.................|.................x....\n.....x................|................x.....\n......xx..............|..............xx......\n.......xx.............|.............xx.......\n........xxx...........|...........xxx........\n..........xx..........|..........xx..........\n............xx........|........xx............\n..............xxx.....|.....xxx..............\n----------------xxxxxxxxxxxxx---------------\u003e\n......................|......................\n......................|......................\n......................|......................\n......................|......................\n......................|......................\n......................|......................\n......................|......................\n......................|......................\n......................|......................\n......................|......................\n......................|......................\n......................|......................\n```\n\n### Cube function\n\n```\n$ make cub; ./cub\nCubic function: y=x^3\n......................^......................\n......................|....................x.\n......................|....................x.\n......................|...................x..\n......................|..................x...\n......................|.................x....\n......................|................xx....\n......................|...............xx.....\n......................|..............xx......\n......................|.............x........\n......................|...........xx.........\n......................|........xxx...........\n-------------xxxxxxxxxxxxxxxxxxx------------\u003e\n...........xxx........|......................\n.........xx...........|......................\n........x.............|......................\n......xx..............|......................\n.....xx...............|......................\n....xx................|......................\n....x.................|......................\n...x..................|......................\n..x...................|......................\n.x....................|......................\n.x....................|......................\nx.....................|......................\n```\n\n## How do I use it?\n\nTo use `grap.h`, simply import the library into your project and call the functions within it.\n\nThe functions are listed below:\n\n| Function      | Use case                                       |\n| ------------- | ---------------------------------------------- |\n| `graphCreate` | Create the graph character array and return it |\n| `graphDraw`   | Display the graph character array              |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbratpeki%2Fgrap.h","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbratpeki%2Fgrap.h","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbratpeki%2Fgrap.h/lists"}