See the shape of your data. Dataspex is a point-and-click Clojure(Script) data browser that lets you peer into maps, vectors, and seqs; explore Datascript and Datomic connections; trace changes to atoms and databases over time; and more -- with minimal effort and a short learning curve.
no.cjohansen/dataspex {:mvn/version "2025.08.1"}
Dataspex runs as a Chrome and Firefox extension — or as a standalone web app — and connects to local ClojureScript apps, Clojure REPLs, or across the network so you can debug apps on your phone.
Whether you're debugging a live system or scrying the hidden structure of your app state, Dataspex gives you eyes on the flow.
Watch the grand tour of Dataspex in 10 minutes.
Dataspex is the spiritual successor to Gadget Inspector.
Dataspex is currently "hardening". It works for a wide variety of use cases, but there are some sharp edges. The browser extensions are not currently in the official extension stores because the contract between the library and the extensions may still change. At this point you should build the extensions (see below) for the corresponding library version you are using.
I expect Dataspex to be stable and with officially released browser extensions by the end of September 2025.
Using Dataspex is easy: require dataspex.core
and call inspect
on your data.
When used from Clojure, it will start a server on port 7117. The browser
extension automatically connects to this port.
(require '[dataspex.core :as dataspex])
;; Atoms will automatically be watched for changes, including a live updated
;; changelog with diffs
(def store (atom {}))
(dataspex/inspect "App state" store)
;; Inspect any piece of data with a label. Multiple calls to `inspect` with the
;; same label will update Dataspex' view of the data, and produce an audit
;; trail.
(def page-data {:title "My page"})
(dataspex/inspect "Page data" page-data)
;; Datascript databases can be viewed through a custom UI
(require '[datascript.core :as d])
(def conn
(d/create-conn
{:person/id {:db/unique :db.unique/identity}
:person/friends {:db/valueType :db.type/ref
:db/cardinality :db.cardinality/many}}))
,,,
(dataspex/inspect "DB" conn)
;; Inspect taps
(dataspex/inspect-taps)
Display data from your ClojureScript app and/or JVM backend live in your browser's devtools panel, and enjoy a bunch of finely tuned point-and-click features, including:
clojure.core.protocols/Datafiable
And much more.
The Makefile build tasks for the Chrome and Firefox browser extensions rely on the xmllint
binary
to embed the current version string. This is typically included with an installation of libxml2
or
libxml2-utils
on Linux distributions (libxml2
is installed by default on MacOS).
To build the Chrome extension:
make chrome-extension
Then go to chrome://extensions/, enable devtools, and
click "Load unpacked". Choose the brower-extension
directory in this repo, and
you should be good to go.
To build the Firefox extension:
make firefox-extension
You will need Firefox Developer Edition.
devtools.chrome.enabled
to true
devtools.debugger.remote-enabled
to true
devtools.debugger.prompt-connection
to false
(optional, reduces prompts)extensions.webextensions.remote
to true
(required for devtools
extensions)If you make changes to the extension code, click "reload".
Dataspex' primary use case is as an extension to the browser's devtools. But this isn't the only way to run Dataspex, and it certainly isn't the most ergonomical way to develop it. Luckily, you can run Dataspex as any old webapp.
To run the development version of Dataspex:
npx shadow-cljs watch app portfolio
You can now find Portfolio (all the UI elements) on http://localhost:9090/portfolio.html. The entry point is portfolio/dataspex/scenes.cljs.
...and a sample Dataspex instance on http://localhost:9090. Its entry point is dev/dataspex/dev.cljs.
Finally, there's a comprehensible test suite that can be run with:
bin/kaocha --watch
A guide to the code and some more docs are pending. In the meantime, here's the bird's eye overview.
dataspex.core
defines the public API. All other namespaces are internal until
publicly documented.
dataspex.data
: Datafy and navigate data structuresdataspex.hiccup
: Rendering logic for data structures, most important
entry-points are render-inline
, render-dictionary
, render-source
, and
render-table
dataspex.audit_log
: Rendering logic for the audit logdataspex.protocols
: The protocols that power Dataspex' renderingdataspex.views
: Shared view options and utilitiesdataspex.inspector
: Inspecting values: subscribing to changes, rendering,
recording history/audit trail, etc.dataspex.tap_inspector
: Inspecting tapsdataspex.ui
: UI elements, the building blocks.dataspex.icons
: The Phosphor icons used (see namespace docstring).dataspex.panel
: The Dataspexdataspex.actions
: UI interaction dispatchdataspex.codec
: To and from strings for out of process communicationdataspex.diff
: Dataspex' use of Editscriptdataspex.time
: Very limited date-time stuffdataspex.user_agent
: User agent parserdataspex.datalog
: Shared logic for Datomic/Datascriptdataspex.datascript
dataspex.datomic
dataspex.date
: JavaScript Datesdataspex.jwt
: JSON Web Tokensdataspex.server
: The Dataspex server, used when inspecting data on the JVMdataspex.browser_extension
: Entry-point for the browser extensiondataspex.remote_inspector
: Entry-point for the remote inspector (e.g. http://localhost:7117)dataspex.browser_extension_client
: Client that receives render calls and
sends actions through the browser extension messaging systemdataspex.in_process_client
: Client that subscribes to render calls and sends
actions in-process: basically the engine of the development version of
Dataspexdataspex.server_client
: Client that subscribes to render calls and sends
actions over the HTTP server: how Dataspex renders data inspected on the JVMdataspex.in_process_host
: Host that sends renders and subscribes to actions in-processdataspex.remote_host
: Host that sends renders and subscribes actions over HTTPdataspex.render_client
: Client wiringdataspex.render_host
: Host wiringCopyright © 2025 Christian Johansen. Distributed under the MIT License.
Can you improve this documentation? These fine people already did:
Christian Johansen, Jeroen van Dijk & Cormac CannonEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |