{"id":28534580,"url":"https://github.com/weavejester/imprimatur","last_synced_at":"2025-10-14T04:12:15.088Z","repository":{"id":62432963,"uuid":"55825372","full_name":"weavejester/imprimatur","owner":"weavejester","description":"Data visualization library for ClojureScript and React","archived":false,"fork":false,"pushed_at":"2016-10-20T10:10:39.000Z","size":28,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-11T13:06:13.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/weavejester.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":"2016-04-09T04:09:29.000Z","updated_at":"2019-09-20T20:48:08.000Z","dependencies_parsed_at":"2022-11-01T20:45:47.737Z","dependency_job_id":null,"html_url":"https://github.com/weavejester/imprimatur","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/weavejester/imprimatur","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fimprimatur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fimprimatur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fimprimatur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fimprimatur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weavejester","download_url":"https://codeload.github.com/weavejester/imprimatur/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Fimprimatur/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017981,"owners_count":26086212,"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-10-14T02:00:06.444Z","response_time":60,"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-06-09T17:11:57.036Z","updated_at":"2025-10-14T04:12:15.084Z","avatar_url":"https://github.com/weavejester.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Imprimatur\n\n*Let it be printed*\n\nA ClojureScript library for visualizing a data structure as a\n[React][] component.\n\nIt's designed primarily to work with [Brutha][], but should also be\nusable from other React-based libraries.\n\n[react]:  https://facebook.github.io/react/\n[brutha]: https://github.com/weavejester/brutha\n\n## Installation\n\nTo install, add the following to your project `:dependencies`:\n\n    [imprimatur \"0.1.3\"]\n\n## Usage\n\nImprimatur provides a `print` function that returns a component\nvisualizing a data structure.\n\n```clojure\n(ns example.core\n  (:require [brutha.core :as br]\n            [imprimatur.core :as imp]))\n\n(def main (.getElementById js/document \"main\"))\n\n(br/mount (imp/print {:root \"Hello World\"}) main)\n```\n\nThis will display the `\"Hello World\"` string in the element with an id\nof `main`.\n\nYou can also visualize collections:\n\n```clojure\n(br/mount (imp/print {:root {:foo \"bar\"}}))\n```\n\nHowever, you may notice that in this case, the collection is displayed\nlike:\n\n```\n{...}\n```\n\nThis is because collections are closed by default. To open the\ncollection we need to set its visibility:\n\n\n```clojure\n(imp/print {:root {:foo \"bar\"}, :visibility {}})\n```\n\nVisibility is defined as a data structure. If the result of:\n\n```clojure\n(get-in visibility keys)\n```\n\nIs truthy, then the collection indexed by `keys` will be open. If not,\nit will be closed. For example:\n\n```clojure\n(imp/print {:root {:a {:b {:c :d} :e {:f :g}}}\n            :visibility {:a {:b {}}}})\n```\n\nThis opens the data structure at `:a` and `:b`, but not at `:e`. The\nvisualization will resemble:\n\n```\n{:a {:b {:c :d} :e {...}}}\n```\n\nAnother way of generating the visibility data structure is to use the\n`open` and `close` functions:\n\n```\n(-\u003e nil (imp/open [:a :b]))\n=\u003e {:a {:b {}}}\n```\n\n\nTo allow the end user to change the visibility, you'll need to set an\n`:on-toggle` handler. This function is called when the user clicks one\nof the toggle buttons. You can use it to change the visibility.\n\nFor example:\n\n```clojure\n(def data {:a {:b {:c :d} :e {:f :g}}})\n\n(def visibility (atom nil))\n\n(defn render []\n  (br/mount\n   (imp/print\n    {:root       data\n     :visibility @visibility\n     :on-toggle  #(swap! visibility imp/toggle %)})\n   main))\n\n(add-watch visibility :change (fn [_ _ _ _] (render)))\n\n(render)\n```\n\nThe `toggle` function will `open` a collection if it's closed, or\n`close` a collection if it's open.\n\nLook in the `example` directory of the repository for a more detailed\nexample.\n\n## License\n\nCopyright © 2016 James Reeves\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweavejester%2Fimprimatur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweavejester%2Fimprimatur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweavejester%2Fimprimatur/lists"}