{"id":33900928,"url":"https://github.com/haskell-github-trust/static-canvas","last_synced_at":"2025-12-11T23:28:18.320Z","repository":{"id":26974940,"uuid":"30438517","full_name":"haskell-github-trust/static-canvas","owner":"haskell-github-trust","description":"A tiny DSL for HTML5 Canvas","archived":false,"fork":false,"pushed_at":"2019-05-22T02:55:04.000Z","size":4018,"stargazers_count":34,"open_issues_count":4,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-08T14:19:51.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/static-canvas","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haskell-github-trust.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-06T23:53:54.000Z","updated_at":"2025-11-15T02:33:56.000Z","dependencies_parsed_at":"2022-08-20T22:31:23.356Z","dependency_job_id":null,"html_url":"https://github.com/haskell-github-trust/static-canvas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/haskell-github-trust/static-canvas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-github-trust%2Fstatic-canvas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-github-trust%2Fstatic-canvas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-github-trust%2Fstatic-canvas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-github-trust%2Fstatic-canvas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haskell-github-trust","download_url":"https://codeload.github.com/haskell-github-trust/static-canvas/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-github-trust%2Fstatic-canvas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27672064,"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","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-12-11T23:28:17.553Z","updated_at":"2025-12-11T23:28:18.315Z","avatar_url":"https://github.com/haskell-github-trust.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# static-canvas [![Hackage](https://img.shields.io/hackage/v/static-canvas.svg?style=flat)](https://hackage.haskell.org/package/static-canvas)\nA simple DSL for writing HTML5 Canvas in haskell and converting it\nto Javascript. By static we mean non-interactive, so the parts of\nthe Canvas API that need to query the browser for run time information\nlike `isPointInPath(x, y)` are not included. This turns out to be\na surprisingly small part of HTML5 Canvas.\n\nHere is Hello static-canvas with fancy text.\n\n![Text](http://i.imgur.com/HGjSpJ6.png)\n\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n\nmodule Main where\n\nimport Graphics.Static\nimport Graphics.Static.ColorNames\n\ntext :: CanvasFree ()\ntext = do\n  font \"italic 60pt Calibri\"\n  lineWidth 6\n  strokeStyle blue\n  fillStyle goldenrod\n  textBaseline TextBaselineMiddle\n  strokeText \"Hello\" 150 100 \n  fillText \"Hello World!\" 150 100\n\nmain :: IO ()\nmain = writeCanvasDoc \"Text.html\" 600 400 text\n```\nThere are plenty of examples in [Examples](https://github.com/jeffreyrosenbluth/static-canvas/tree/master/examples).\nHere is one more showing how to use pattern to fill a rectangle.\n\n![line](http://i.imgur.com/RRvyXyv.png)\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n\nmodule Main where\n\nimport Graphics.Static\n\npattern :: CanvasFree ()\npattern = do\n  img \u003c- newImage \"tile.png\"\n  onImageLoad img $ do\n    ptn \u003c- createPattern img Repeat\n    rect 0 0 400 400\n    fillStyle ptn\n    fill\n\nmain :: IO ()\nmain = writeCanvasDoc \"Pattern.html\" 400 400 pattern\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-github-trust%2Fstatic-canvas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaskell-github-trust%2Fstatic-canvas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-github-trust%2Fstatic-canvas/lists"}