Does reveal have the ability to live update views on refs? Say I have an atom with a map in it. Can I get a bar chart of the map updating as the value in the atom changes?
Yes! vlaaad.reveal.ext/observable-view
There is an example: https://github.com/vlaaad/reveal/blob/master/examples/e02_integrant_live_system_view.clj
😲 next level stuff
The future is here
thanks for your work! now I finally have an excuse to dig into cljfx as well :)
Here is a small example with bar chart:
(require '[vlaaad.reveal.ext :as rx])
(def x {:a 1 :b 2 :c 4})
(rx/open-view
{:fx/type rx/observable-view
:ref #'x
:fn (fn [m]
{:fx/type rx/bar-chart-view
;; wrap in set because bar-chart-view requires 2 levels of nesting
:data #{m}})})
;; redefine
(def x {:a 1 :b 2 :c -1})my pleasure!