{"id":23086178,"url":"https://github.com/doughamil/threeagent","last_synced_at":"2025-04-07T12:09:21.294Z","repository":{"id":37588044,"uuid":"165165810","full_name":"DougHamil/threeagent","owner":"DougHamil","description":"ClojureScript library for building Three.js apps in a reagent-like fashion","archived":false,"fork":false,"pushed_at":"2024-01-09T20:13:37.000Z","size":1273,"stargazers_count":135,"open_issues_count":6,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-07T12:09:17.233Z","etag":null,"topics":["clojure","clojurescript","clojurescript-library","reagent","threejs"],"latest_commit_sha":null,"homepage":null,"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/DougHamil.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}},"created_at":"2019-01-11T02:32:43.000Z","updated_at":"2025-03-07T11:27:34.000Z","dependencies_parsed_at":"2023-02-15T08:46:25.572Z","dependency_job_id":"b4f609ea-a131-4c63-a29a-c8c3571a7c0e","html_url":"https://github.com/DougHamil/threeagent","commit_stats":{"total_commits":171,"total_committers":4,"mean_commits":42.75,"dds":0.1228070175438597,"last_synced_commit":"59281f1ca45f84bd224ea1cf4a35e3e9268fbbe7"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougHamil%2Fthreeagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougHamil%2Fthreeagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougHamil%2Fthreeagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DougHamil%2Fthreeagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DougHamil","download_url":"https://codeload.github.com/DougHamil/threeagent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"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":["clojure","clojurescript","clojurescript-library","reagent","threejs"],"created_at":"2024-12-16T18:42:08.239Z","updated_at":"2025-04-07T12:09:21.274Z","avatar_url":"https://github.com/DougHamil.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# threeagent\n[![CircleCI](https://circleci.com/gh/DougHamil/threeagent/tree/main.svg?style=svg)](https://circleci.com/gh/DougHamil/threeagent/tree/main)\n[![cljdoc badge](https://cljdoc.org/badge/doughamil/threeagent)](https://cljdoc.org/d/doughamil/threeagent)\n\nClojureScript library for building Three.js apps in a reagent-like fashion\n\n## Installation\n[![Clojars Project](https://clojars.org/doughamil/threeagent/latest-version.svg)](https://clojars.org/doughamil/threeagent)\n\nthreeagent depends on THREE.js, so it will need to be added as a dependency to your project as well.\n\nFor shadow-cljs, install THREE.js using npm:\n```\nnpm install --save three\n```\n\nFor lein-cljsbuild, add an npm-deps entry on THREE.js:\n```clojure\n:cljsbuild {:builds [{...\n                      :compiler {...\n                                 :install-deps true\n                                 :npm-deps {:three \"0.100.0\"}}}]}\n```\n \n## Example\n```clojure\n(ns my-app.core\n  (:require [threeagent.core :as th]))\n  \n;; Use reactive atom for storing state\n(defonce state (th/atom {:ticks 0}))\n\n;; Tick every second\n(.setInterval js/window #(swap! state update :ticks inc) 1000)\n\n;; Form-1 component example\n(defn color-box [color size]\n  [:box {:dims [size size size]\n         :material {:color color}}])\n         \n;; Form-2 component example\n(defn growing-sphere []\n  (let [s (atom 0)]\n    (.setInterval js/window #(swap! s inc) 5000)\n    (fn []\n      [:sphere {:radius @s}])))\n\n;; Root component render function\n(defn root []\n  [:object {:position [1.0 0 -4.0]\n            :rotation [0 (.sin js/Math (:ticks @state)) 0]} ; Rotate on Y axis based on :ticks\n    [:ambient-light {:intensity 0.8}]\n    [color-box \"red\" 1.0] ; Don't forget to use square brackets!\n    [growing-sphere]])\n           \n           \n;; Initialize and begin rendering threeagent scene\n(defonce scene (th/render root (.-body js/document)))\n```\n\n## Documentation\n\nThe latest documentation is available [here](https://cljdoc.org/d/doughamil/threeagent)\n\n## Development\n\n### Running Tests\nUse shadow-cljs to watch unit tests\n\n```bash\nnpx shadow-cljs watch test\n```\n\nNavigate to the HTTP server that shadow-cljs creates to view the test results\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoughamil%2Fthreeagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoughamil%2Fthreeagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoughamil%2Fthreeagent/lists"}