reveal

eval-on-point 2021-10-07T15:47:07.070400Z

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?

vlaaad 2021-10-07T16:27:57.070500Z

Yes! vlaaad.reveal.ext/observable-view

eval-on-point 2021-10-07T16:37:04.071Z

😲 next level stuff

vlaaad 2021-10-07T16:37:32.071200Z

The future is here

eval-on-point 2021-10-07T16:38:38.071400Z

thanks for your work! now I finally have an excuse to dig into cljfx as well :)

vlaaad 2021-10-07T16:44:10.071600Z

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})

vlaaad 2021-10-07T16:46:09.071800Z

my pleasure!