reveal

Docs: https://vlaaad.github.io/reveal/ Source: https://github.com/vlaaad/reveal
phronmophobic 2021-01-05T19:21:44.053100Z

now that I’ve found out that it’s easy to write reveal plugins, Im considering what kind of plugins I might find useful enough to write. Some examples: • a profiler • an exception explorer with tracing and instrumentation support • more visualizations Looking at the list and it seems like some of the ideas are tools typically provided by an IDE. Would these types of plugins be a good fit for reveal? Should I be considering other IDEs that might already provide these tools? I do think there’s value in having these dev tools in process. RDD has already primed me to like the idea of my repl starting up my IDE rather than the other way around. thoughts?

vlaaad 2021-01-05T19:43:03.053200Z

Good initiative! I think all your examples are good things to do, given how everything can be connected and explored with popup-view the sum would be much more than the sum of the parts

vlaaad 2021-01-05T19:45:38.053400Z

I also think it makes sense to look at IDE features because reveal is available in every IDE, so implementing an IDE feature there will make it available to the whole community instead of a subset of Clojure users that use that particular IDE.

vlaaad 2021-01-05T19:55:01.053600Z

To be fair "the whole community" is not every Clojure user, but every Reveal user 😂 Still, I find Reveal — at least for myself — much more useful as a REPL than what I see built into other Clojure IDEs, so I would still say it's very useful because (a) it will make it easier to change IDEs without losing much in the process of transition and (b) reveal allows stitching tools together with it's action popup system, which is not something IDEs do.

phronmophobic 2021-01-05T20:12:30.053800Z

I was thinking similarly, but wanted to check that it was philosophically aligned with reveal

phronmophobic 2021-01-05T20:14:14.054Z

additionally, the amount of code for each plugin that is specific to reveal is minimal so if I wanted to try these plugins out in another IDE, it should be theoretically possible (except I run my IDE in terminal).

vlaaad 2021-01-05T21:47:26.054900Z

Made a little experiment that adds support for vega charts from vega-lite specs as plain clojure maps:

2021-01-11T14:07:53.066800Z

This is cool, @vlaaad! Adding to your point about the power of this visualization engine, the vega-lite high-level grammar is also nice and useful so good choice there. Thanks for sharing! Appreciate the note about the current limitations but this is really promising.

vlaaad 2021-01-05T21:49:29.055200Z

It's hacky and unreliable and can't get back to data inside those charts (e.g. the view is a leaf), but it's a powerful visualization engine, so here is a snippet (you'll need clojure.data.json dependency):

(action/defaction ::view:vega [x]
  (when (or (and (:data x) (:mark x) (:encoding x))
            (and (:repeat x) (:spec x)))
    (fn []
      {:fx/type fx.ext.web-view/with-engine-props
       :props {:content (str "&lt;head&gt;\n  &lt;script src=\"<https://cdn.jsdelivr.net/npm/vega@5>\"&gt;&lt;/script&gt;\n  &lt;script src=\"<https://cdn.jsdelivr.net/npm/vega-lite@4>\"&gt;&lt;/script&gt;\n  &lt;script src=\"<https://cdn.jsdelivr.net/npm/vega-embed@6>\"&gt;&lt;/script&gt;\n&lt;/head&gt;\n&lt;body&gt;\n  &lt;div id=\"view\"&gt;&lt;/div&gt;\n  &lt;script&gt;\n    vegaEmbed(\n      '#view',\n      "
                             (json/write-str x)
                             "\n    );\n  &lt;/script&gt;\n&lt;/body&gt;\n")}
       :desc {:fx/type :web-view}})))

vlaaad 2021-01-05T21:50:05.055400Z

I only tried it on this sample data:

{:data {:values [{:category :a
                  :amount 10}
                 {:category :b
                  :amount 20}
                 {:category :c
                  :amount 15}]}
 :mark :bar
 :encoding {:x {:field :category
                :type :nominal}
            :y {:field :amount
                :type :quantitative}}}

phronmophobic 2021-01-05T21:54:04.055600Z

I was going to ask if you were displaying it in a web view