{"id":17445947,"url":"https://github.com/jamen/canvas-wasm","last_synced_at":"2025-09-25T01:31:09.467Z","repository":{"id":57193799,"uuid":"103459618","full_name":"jamen/canvas-wasm","owner":"jamen","description":"Canvas functions suitable for WebAssembly","archived":false,"fork":false,"pushed_at":"2017-11-10T14:15:24.000Z","size":6,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T20:03:40.368Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamen.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}},"created_at":"2017-09-13T22:48:15.000Z","updated_at":"2023-03-02T19:32:10.000Z","dependencies_parsed_at":"2022-09-15T22:30:14.974Z","dependency_job_id":null,"html_url":"https://github.com/jamen/canvas-wasm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fcanvas-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fcanvas-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fcanvas-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fcanvas-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamen","download_url":"https://codeload.github.com/jamen/canvas-wasm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234144288,"owners_count":18786339,"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":"2024-10-17T18:18:30.966Z","updated_at":"2025-09-25T01:31:04.149Z","avatar_url":"https://github.com/jamen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# canvas-wasm\n\n\u003e Canvas functions suitable for WebAssembly\n\nCanvas's [`CanvasRenderingContext2D`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) has several methods, setters, and getters **not** suitable for WebAssembly.  Use this module to wrap a context for making it suitable.\n\n**Notice:** This is experimental and doesn't include a lot of things. Currently nothing using [memory](https://github.com/WebAssembly/design/blob/master/Semantics.md#linear-memory) is made.\n\n - [ ] Pixel/image manipulation\n - [ ] Gradients and patterns\n - [ ] Text objects and styling\n - [ ] Hit regions\n - [ ] Other non-standard APIs\n\n## Install\n\n```sh\nnpm i canvas-wasm\n```\n\n**Note:** See [`browserify`](https://github.com/browserify/browserify) and [`wasmify`](https://github.com/jamen/wasmify) for an easy way to building WASM projects.\n\n## Usage\n\n### `create_*`\n\nCreating shapes without using paths\n\n - `create_rect(x, y, width, height)`\n\n### `path_*`\n\n - `path_begin()`\n - `path_close()`\n - `path_move(x, y)`\n - `path_line(x, y)`\n - `path_fill()`\n - `path_stroke()`\n - `path_bezier_curve(c1x, c1y, c2x, c2y, x, y)`\n - `path_quadradic_curve(cx, cy, x, y)`\n - `path_circle(x, y, radius)`\n - `path_arc(x, y, radius, startAngle, endAngle)`\n - `path_ellipse(x, y, rx, ry, rot, startAngle, endAngle)`\n - `path_rect(x, y, width, height)`\n\n### `clear_*`\n\n - `clear()`\n - `clear_rect(x, y, width, height)`\n\n### `set_*`\n\n - `set_stroke_color(r, g, b)`\n - `set_fill_color(r, g, b)`\n - `set_line_width(w)`\n - `set_line_cap(0 | 1 | 2)`\n   - `butt`, `join`, `square` respectively\n - `set_line_join(0 | 1 | 2)`\n   - `round`, `bevel`, `miter` respectively\n - `set_shadow_blur(x)`\n - `set_shadow_color(r, g, b, a)`\n - `set_shadow_offset_x(x)`\n - `set_shadow_offset_y(y)`\n\n### `transform_*`\n\n - `transform_rotate(deg)`\n - `transform_scale(x, y)`\n - `transform_translate(x, y)`\n - `transform(a, b, c, d, e, f)`\n - `set_transform(a, b, c, d, e, f)`\n - `reset_transform()`\n\n### State functions\n\n - `save()`\n - `restore()`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fcanvas-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamen%2Fcanvas-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fcanvas-wasm/lists"}