{"id":27297280,"url":"https://github.com/rorokimdim/mindra-clj","last_synced_at":"2026-03-12T20:15:03.248Z","repository":{"id":160607825,"uuid":"468976139","full_name":"rorokimdim/mindra-clj","owner":"rorokimdim","description":"A 2D Graphics library for clojure using diagrams and gloss.","archived":false,"fork":false,"pushed_at":"2024-08-11T17:52:18.000Z","size":975,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-11T01:51:16.514Z","etag":null,"topics":["clojure","diagrams","gloss"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/rorokimdim.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}},"created_at":"2022-03-12T04:14:29.000Z","updated_at":"2025-06-05T08:47:05.000Z","dependencies_parsed_at":"2025-04-11T23:54:29.657Z","dependency_job_id":"f654cd30-cf23-493c-b3b0-172d61bfdb78","html_url":"https://github.com/rorokimdim/mindra-clj","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rorokimdim/mindra-clj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorokimdim%2Fmindra-clj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorokimdim%2Fmindra-clj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorokimdim%2Fmindra-clj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorokimdim%2Fmindra-clj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rorokimdim","download_url":"https://codeload.github.com/rorokimdim/mindra-clj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorokimdim%2Fmindra-clj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30441857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: 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":["clojure","diagrams","gloss"],"created_at":"2025-04-11T23:54:26.845Z","updated_at":"2026-03-12T20:15:03.223Z","avatar_url":"https://github.com/rorokimdim.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Clojars Project](https://img.shields.io/clojars/v/org.clojars.rorokimdim/mindra.svg)](https://clojars.org/org.clojars.rorokimdim/mindra)\n[![cljdoc badge](https://cljdoc.org/badge/org.clojars.rorokimdim/mindra)](https://cljdoc.org/d/org.clojars.rorokimdim/mindra)\n\n# mindra-clj\n\nA 2D graphics library for clojure using [mindra](https://github.com/rorokimdim/mindra) -- a cli for [diagrams](https://diagrams.github.io/)\nand [gloss](http://gloss.ouroborus.net/).\n\n# Installation\n\n**A.** Install mindra from [mindra-binary](https://github.com/rorokimdim/mindra#installation)\n\nIf you encounter any problems, please file an issue.\n\n**B.** Set up a clojure project\n\n**Leiningen/Boot**\n\n```clojure\n[org.clojars.rorokimdim/mindra \"0.0.4\"]\n```\n\n**deps.edn**\n\n```clojure\norg.clojars.rorokimdim/mindra {:mvn/version \"0.0.4\"}\n```\n\n# Usage\n\n`mindra` has two set of functions (APIs): [one](https://github.com/rorokimdim/mindra-clj/blob/master/src/mindra/diagrams.clj) for diagrams and [another](https://github.com/rorokimdim/mindra-clj/blob/master/src/mindra/gloss.clj) for gloss. They are not intended to be used together: when creating a gloss picture, we should avoid using functions from the diagrams namespace, and vice versa.\n\nTry drawing a simple circle in a repl:\n\n**A circle using Diagrams**\n\n```clojure\n(require '[mindra.core :refer [diagram-\u003esvg]])\n(require '[mindra.diagrams :as md])\n\n(defn draw-circle [radius]\n  (let [svg (diagram-\u003esvg (md/circle radius))]\n    (spit \"circle.svg\" svg)))\n\n; Writes to \"circle.svg\" file.\n; For other formats, try mindra.core/diagram-\u003efile.\n; For displaying the image in a gui window, try mindra.core/show-diagram\n(draw-circle 100)\n```\n\n**A circle using Gloss**\n\n```clojure\n(require '[mindra.core :refer [gloss-draw]])\n(require '[mindra.gloss :as mg])\n\n(defn draw-circle [radius]\n  (let [picture (mg/circle radius)]\n    (gloss-draw picture)))\n\n(draw-circle 100)\n```\n\nHit `ESC` to close the window. See [default-key-bindings](https://github.com/benl23x5/gloss#usage).\n\nNext, checkout the [examples](https://github.com/rorokimdim/mindra-clj#examples).\n\n# Q/A\n\n**A.** How does it compare with library x?\n\ntldr; I don't know yet or I may not have tried it.\n\nI wanted something like [htdp/image](https://docs.racket-lang.org/teachpack/2htdpimage.html), [2htdp/universe](https://docs.racket-lang.org/teachpack/2htdpuniverse.html) for clojure, without the pain (and required skillset) of building it myself. Leveraging diagrams and gloss, which I was already familiar with, seemed like the easiest solution.\n\n**B.** Why is the graphics not as smooth as in library x?\n\n`mindra` inherits all the tradeoffs made by `diagrams` and `gloss`, and all their deficiencies. It also has quirks of its own and, at this stage, probably plenty of bugs too.\n\nHowever, if you observe poorer graphics with `mindra` compared to diagrams/gloss, please file an issue.\n\n**C.** Will it support feature x?\n\nPlease file an issue/feature-request.\n\n**D.** Babashka, GraalVM?\n\nAs long as mindra binary is available, this library is expected to work in both! If it doesn't, please file an issue.\n\n# Examples\n\n## Diagrams\n\nSVGs can be created using `diagrams` library. Please check out \u003ca href=\"https://diagrams.github.io/\"\u003ediagrams.github.io\u003c/a\u003e to learn more.\n\nOnly a small subset of the features provided by `diagrams` is supported at this time.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-hilbert-pattern.svg\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L130\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-circle-pattern.png\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L118\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-square-pattern.png\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L160\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-sine.svg\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L232\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n    \u003cimg src=\"images/diagrams/draw-tower.svg\" width=\"200\"/\u003e\n    \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L86\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-basic.svg\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L12\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n    \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-rectangle.svg\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L187\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n    \u003cimg src=\"images/diagrams/draw-tree-pattern.png\" width=\"200\"/\u003e\n    \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L173\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-arrows.svg\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L39\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-line-pattern.svg\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L143\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-circle.svg\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L107\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cimg src=\"images/diagrams/draw-bspline.svg\" width=\"200\"/\u003e\n      \u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/0707467c4b0822b7173c5df8bf05edba94b8005c/dev/mindra/examples/diagrams.clj#L223\"\u003esource\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Gloss\n\nPlease check out \u003ca href=\"http://gloss.ouroborus.net/\"\u003egloss.ouroborus.net\u003c/a\u003e to learn more.\n\nA good subset of the features provided by `gloss` is already supported.\n\n**A.** Basic drawing\n\n\u003cimg src=\"images/gloss/draw-basic.png\" width=\"400\"/\u003e\n\n\u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/f5b787a9c7be6784bbc3eac953723d87e3ca2130/dev/mindra/examples/gloss.clj#L8\"\u003esource\u003c/a\u003e (images used obtained from [dumbmanex.com](https://github.com/rorokimdim/mindra-clj/blob/master/images/dumbmanex.com/credits.txt))\n\n**B.** Hilbert curve animation\n\nhttps://user-images.githubusercontent.com/929342/160046861-e0f61455-adc0-48c8-8882-ddef80f55d18.mov\n\n\u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/f5b787a9c7be6784bbc3eac953723d87e3ca2130/dev/mindra/examples/gloss.clj#L186\"\u003esource\u003c/a\u003e (images obtained from [dumbmanex.com](https://github.com/rorokimdim/mindra-clj/blob/master/images/dumbmanex.com/credits.txt))\n\n**C.** Snowballer animation\n\nhttps://user-images.githubusercontent.com/929342/160048147-2fc39ea7-feb1-409e-adb1-288a869fe4ff.mov\n\n\u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/f5b787a9c7be6784bbc3eac953723d87e3ca2130/dev/mindra/examples/gloss.clj#L139\"\u003esource\u003c/a\u003e\n\n**D.** Simple animation with event handling\n\nhttps://user-images.githubusercontent.com/929342/160048948-8acfbca6-63c7-4cfe-9adb-e3418b414807.mov\n\n\u003ca href=\"https://github.com/rorokimdim/mindra-clj/blob/f5b787a9c7be6784bbc3eac953723d87e3ca2130/dev/mindra/examples/gloss.clj#L117\"\u003esource\u003c/a\u003e\n\n\n## Credits\n\n0. [Clojure](https://clojure.org/)\n1. [Diagrams](https://diagrams.github.io/) and [Gloss](https://hackage.haskell.org/package/gloss)\n2. All of these [libraries](https://github.com/rorokimdim/mindra-clj/blob/master/project.clj)\n\n## License\n\nCopyright © 2022 Amit Shrestha\n\nThis program and the accompanying materials are made available under [MIT License](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frorokimdim%2Fmindra-clj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frorokimdim%2Fmindra-clj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frorokimdim%2Fmindra-clj/lists"}