{"id":29007466,"url":"https://github.com/brubsby/cozyvec","last_synced_at":"2025-06-25T13:09:16.074Z","repository":{"id":37195748,"uuid":"236373190","full_name":"brubsby/cozyvec","owner":"brubsby","description":"Cozy Plotter Art Terminal","archived":false,"fork":false,"pushed_at":"2023-10-05T18:58:38.000Z","size":776,"stargazers_count":69,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-01-24T00:44:06.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/brubsby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"ko_fi":"brubsby"}},"created_at":"2020-01-26T20:39:43.000Z","updated_at":"2023-11-14T09:36:36.000Z","dependencies_parsed_at":"2024-01-24T00:52:08.482Z","dependency_job_id":null,"html_url":"https://github.com/brubsby/cozyvec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brubsby/cozyvec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brubsby%2Fcozyvec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brubsby%2Fcozyvec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brubsby%2Fcozyvec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brubsby%2Fcozyvec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brubsby","download_url":"https://codeload.github.com/brubsby/cozyvec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brubsby%2Fcozyvec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261879312,"owners_count":23223739,"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":[],"created_at":"2025-06-25T13:09:15.149Z","updated_at":"2025-06-25T13:09:16.037Z","avatar_url":"https://github.com/brubsby.png","language":"JavaScript","readme":"# cozyvec\n\ncozyvec is a terminal program for creating [plotter](https://en.wikipedia.org/wiki/Plotter) art (specifically via SVG files) in javascript with minimal setup.\n\n![Image](https://github.com/brubsby/cozyvec/blob/master/resources/web_example.png)\n\nThe library has been designed for brevity, so the code for a specific plot can be tweeted under the hashtag [#cozyvec](https://twitter.com/hashtag/cozyvec) (much like PICO-8's [#tweetcart](https://twitter.com/hashtag/tweetcart) and processing's [#つぶやきProcessing](https://twitter.com/hashtag/つぶやきProcessing)) by providing shortcut versions of most tokens that are 1-4 characters.\n\n![Image](https://github.com/brubsby/cozyvec/blob/master/resources/short_example.png)\n\n## Browser Version\n\nBrowser version available at: https://brubsby.github.io/cozyvec\n\nHowever, the standalone builds are a better user experience (menu items)\n\n## Install \u0026 Run\n\nYou can download [builds](https://brubsby.itch.io/cozyvec) for OSX, Windows and Linux, or if you wish to build it yourself, follow these steps:\n\n```\ngit clone https://github.com/brubsby/cozyvec.git\ncd cozyvec/desktop/\nnpm install\nnpm start\n```\n\n## Library\n\n- `l2|lineTo(x,y)` draw line from last point\n- `m2|moveTo(x,y)` move to point\n- `clsp|closePath()` draw line to last move to point\n- `ppr|paper(name[,orientation])` change paper to size in library\n- `ppr|paper(w,h[,name[,orientation]])` custom paper in mm\n- `pen(w)` pen width in mm, also starts new SVG group (to help with pen swapping)\n- `mbox|marginBox([a[,b[,c[,d]]]])` create bounding box with margins [x1,y1,x2,y2] default 40 mm, partial arguments follow css margin conventions\n- `log(s)` log message s, gets overwritten by errors and other logs\n- `err|error(s)` error message s and quit\n- `W|WIDTH` canvas width\n- `H|HEIGHT` canvas height\n- `PI` π\n- `TAU|TWO_PI` 2*π\n- `HPI|HALF_PI` π/2\n- `QPI|QUARTER_PI` π/4\n- `pow(a,b)` exponentiation\n- `sqrt(a)` square root\n- `sqr|square(a)` square number\n- `cub|cube(a)` cube number\n- `abs(a)` absolute value\n- `ceil(a)` round up to nearest integer\n- `flr|floor(a)` round down to nearest integer\n- `sgn|sign(a)` return the sign of a number\n- `sin(a)` sine\n- `cos(a)` cosine\n- `tan(a)` tangent\n- `asin(a)` arcsine\n- `acos(a)` arccosine\n- `atan(a)` arctangent\n- `at2|atan2(y,x)` arctangent2\n- `min(...a)` minimum\n- `max(...a)` maximum\n- `mid(a,b,c)` clamp b to [a,c]\n- `smid|smoothMid(a,b,c)` clamp b to [a,c] with [smoothing](https://en.wikipedia.org/wiki/Smoothstep)\n- `dst|distance(x1,y1,x2,y2)` distance between points\n- `rnd|random()` random \\[0-1)\n- `rnd|random(a)` random \\[0-a)\n- `rnd|random(a,b)` random \\[a-b)\n- `srnd|seedRandom()` seed rng with 0\n- `srnd|seedRandom(s)` seed rng with s\n- `nse|noise(pos)` [simplex noise](https://en.wikipedia.org/wiki/Simplex_noise) (pos can be a number or 1-4 numbers in a list)\n- `nse|noise(pos,freq,amp)` simplex noise\n- `nse|noise(pos,freq,amp,octaves,lacunarity,gain)` fractal simplex noise\n\n## Shortcuts\n\n- `CmdOrCtrl+G` documentation\n- `CmdOrCtrl+R` run code\n- `CmdOrCtrl+E` export SVG\n- `CmdOrCtrl+I` export PNG\n- `CmdOrCtrl+P` flip paper orientation\n- `CmdOrCtrl+N` new file\n- `CmdOrCtrl+O` open .js file\n- `CmdOrCtrl+S` save .js file\n- `CmdOrCtrl+Tab` dev console\n\n\n## Paper Sizes\n\nPaper sizes are defined [here](https://github.com/brubsby/cozyvec/blob/master/desktop/sources/scripts/papersizes.js), create an issue or PR if you'd like me to add another standardized paper size to select from.\n\nYou can also call `paper|ppr(width_mm, height_mm[, name[, is_portrait]])` at the beginning of your script to define a custom size for your plot.\n\n## Community\n\n- [cozyvec hashtag](https://twitter.com/hashtag/cozyvec)\n- [cozyvectweets bot](https://twitter.com/cozyvectweets)\n- [/r/cozyvec on reddit](https://www.reddit.com/r/cozyvec/)\n\n## Contributing\n\nPlease [create an issue](https://github.com/brubsby/cozyvec/issues/new) if you have questions about behavior, find a bug, or want to make a feature/paper size request! I will also accept PR's, but might edit them first!\n","funding_links":["https://ko-fi.com/brubsby"],"categories":["Software"],"sub_categories":["Vector Creation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrubsby%2Fcozyvec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrubsby%2Fcozyvec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrubsby%2Fcozyvec/lists"}