A Clojure tool for displaying arbitrary, nested data structures as a read-only, form-based UI. DSUI stands for "Data Structure User Interface".
Being tired of writing UI code.
Avoiding this:
And getting this instead:
Via deps:
{:deps {org.clojars.azel4231/dsui {:mvn/version "0.1.1"}}}
Via lein:
:dependencies [[org.clojars.azel4231/dsui "0.1.1"]]
Via maven:
<dependency>
<groupId>org.clojars.azel4231</groupId>
<artifactId>dsui</artifactId>
<version>0.1.1</version>
</dependency>
(require '[dsui.swing :as d])
Display data as a form-based UI:
(d/dsui any-data)
Show how data conforms to a spec. Useful for specs with choices (via s/or) or labeled values (vis s/cat). If the data does not conform, displays the explanation (explain-data) as a ui:
(d/conform-ui ::any-spec any-data)
Attach dsui to a ref and leave it open:
(defonce state (atom []))
(defonce ui (d/watch-ui state))
Swap new data into the atom to update the watch-ui window (REPL workflow)
(reset! state '[1 2 3 "A" "B" "C" + - * /])
Or just have it display your app's changing app-state.
Displays:
Does not support:
Not suited for:
DSUI uses clojure.spec to "parse" an arbitrary data structure. The conformed data is used to generate the swing UI by calling a multimethod that polymorphically creates different types of UI elements.
More detailed explanations can be found here and here
Distributed under the Eclipse Public License, the same as Clojure.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close