{"id":15627185,"url":"https://github.com/eggsyntax/cljs-mathbox","last_synced_at":"2025-08-03T08:06:50.592Z","repository":{"id":62431577,"uuid":"47580064","full_name":"eggsyntax/cljs-mathbox","owner":"eggsyntax","description":"ClojureScript wrapper for the MathBox JS library","archived":false,"fork":false,"pushed_at":"2015-12-09T17:13:32.000Z","size":23,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-26T10:49:32.845Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/eggsyntax.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":"2015-12-07T21:24:01.000Z","updated_at":"2024-02-15T15:45:34.000Z","dependencies_parsed_at":"2022-11-01T20:46:38.930Z","dependency_job_id":null,"html_url":"https://github.com/eggsyntax/cljs-mathbox","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/eggsyntax/cljs-mathbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggsyntax%2Fcljs-mathbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggsyntax%2Fcljs-mathbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggsyntax%2Fcljs-mathbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggsyntax%2Fcljs-mathbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggsyntax","download_url":"https://codeload.github.com/eggsyntax/cljs-mathbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggsyntax%2Fcljs-mathbox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268496040,"owners_count":24259406,"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-08-03T02:00:12.545Z","response_time":2577,"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":"2024-10-03T10:15:35.889Z","updated_at":"2025-08-03T08:06:50.562Z","avatar_url":"https://github.com/eggsyntax.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cljs-mathbox\n\n[cljs-mathbox](https://github.com/eggsyntax/cljs-mathbox) is a ClojureScript wrapper for the [MathBox 1](https://github.com/unconed/MathBox.js/tree/legacy) JavaScript mathematical visualization library.\n\n## Overview\n\nNOTE: This library is a thin wrapper. 99% of the documentation is on the [MathBox](https://github.com/unconed/MathBox.js/tree/legacy) page.\n\n[MathBox](https://github.com/unconed/MathBox.js/tree/legacy) is an extremely powerful library for mathematical (and data) visualization in the browser, specializing in interactive, three-dimensional, animated visualizations, created by [Steven Wittens](http://acko.net/about/). It's built on the [Three.js](https://github.com/mrdoob/three.js/) library, which is built on [WebGL](https://en.wikipedia.org/wiki/WebGL). You can see a number of impressive MathBox visualizations at the author's website, [acko.net](http://acko.net/).\n\nIt should be noted that this library is based on MathBox version 1. MathBox version 2, which will be a very different, more powerful library, and is [nearing completion](http://acko.net/blog/mathbox2/) as of this writing (12/2015). Nevertheless, MathBox 1 is quite powerful in its own right.\n\nFor MathBox 1 documentation, see [its repo](https://github.com/unconed/MathBox.js/tree/legacy) (be aware that Mathbox 2 is [hosted elsewhere](https://gitgud.io/unconed/mathbox)). cljs-mathbox is a fairly thin wrapper over the original. It exposes the primitives (platonic, curve, bezier, surface, bezier-surface, vector, grid, axis, viewport, camera), and the major functions (animate, clone, remove, get-props, set-props).\n\nYou can see example usage of cljs-mathbox at the accompanying [cljs-mathbox-example](https://github.com/eggsyntax/cljs-mathbox-example). In short: include and require the library, create a mathbox instance, and call functions on it.\n\nNOTE that you'll need at least one WebGL shader, and this repo [includes one](https://github.com/eggsyntax/cljs-mathbox/blob/master/shaders/snippets.glsl.html).\n\nNOTE: when you load a cljs-mathbox visualization, you'll see a string of errors like \"WebGL: INVALID_OPERATION: getUniformLocation: program not linked\". This is a MathBox issue (related to the Three.js dependency), so cljs-mathbox is stuck with it.\n\n## Library usage\n\nAdd the following dependency: `[cljs-mathbox \"1.0.1\"]`\nand then you can `(:require [cljs-mathbox.mathbox])`.\n\nSimple example:\n\n```clojurescript\n(ns MYPROJECT\n  (:require [cljs-mathbox.mathbox :as mb]\n            [cljs.core.async :refer [\u003c! timeout]])\n  (:require-macros [cljs.core.async.macros :refer [go]]))\n\n;; Create mathbox. Name of div should match a div in your HTML (which must be\n;; non-empty or the browser will optimize it out; just a \u0026nbsp; will do fine.\n(let [m (mb/create-mathbox \"shaders/snippets.glsl.html\" {} \"mathboxdiv\")]\n  ;; We need a moment for the creation to finish\n  (go (\u003c! (timeout 200))\n      (-\u003e m\n          ;; Place the camera where you like\n          (mb/camera {:orbit 7.5})\n          ;; Create a cube\n          (mb/platonic {:type :cube\n                        :id \"acube\"})\n          ;; Rotate it over a 6-second period\n          (mb/animate \"#acube\"\n                      {:mathRotation [0 3 0]}\n                      {:duration 6000}))))\n```\n\nFor a larger example, see the [example repo](https://github.com/eggsyntax/cljs-mathbox-example)\n\n## Building this project:\n\nNOTE: typically there's no need to build this project yourself unless you're intending to contribute to cljs-mathbox.\n\nBuild your project once in dev mode with the following script and then open `index.html` in your browser.\n\n    ./scripts/build\n\nTo auto build your project in dev mode:\n\n    ./script/watch\n\nBuild a single release artifact with the following script and then open `index_release.html` in your browser.\n\n    ./scripts/release\n\nThe project is based on the [mies template](https://github.com/swannodette/mies) and further information can be found on its page.\n\n## License\n\nCopyright © 2015 Egg Davis\n\nDistributed under the Eclipse Public License either version 1.0 or (at your option) any later version.\nMathBox is copyright 2012 by Steven Wittens, and distributed under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggsyntax%2Fcljs-mathbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggsyntax%2Fcljs-mathbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggsyntax%2Fcljs-mathbox/lists"}