Fork me on GitHub
#reveal
<
2020-10-14
>
fabrao00:10:02

Hello, is there any way to clear the reveal the data in repl windows?

seancorfield01:10:56

Not yet. Vlad has said he's considering that for a future version.

fabrao01:10:53

today I freezed it 🙂

fabrao01:10:13

so, clean buffer is very important

vlaaad05:10:17

Yeah yeah, that's coming

seancorfield05:10:32

@vlaaad So at this point I've been running Reveal all-day, every-day instead of REBL for over a week. With that auto-table-view code you provided, I haven't felt the need to go back to REBL (although I do still miss the multi-pane view sometimes, showing the expression, the bare value, the metadata and the table/graph view -- I suspect if I modified that auto-table-view to also show the metadata in a vertical panel I'd be satisfied). I do miss the call tree stuff occasionally (but not as much as I expected 🙂 ). Reveal still feels a bit more "work" than REBL -- but it's also more "specific" and more controllable so that's both a pro and a con.

seancorfield05:10:27

(easy mod to display metadata over the table-view... ok, satisfied now 🙂 )

vlaaad06:10:52

Thank you for talking time to provide feedback, Sean! Can you share your metadata table mod so I can add it to reveal example?

seancorfield06:10:23

(let [last-tap (atom nil)]
    (add-tap #(reset! last-tap %))
    (rx/view-as-is
      {:fx/type rx/observable-view
       :ref last-tap
       :fn (fn [x]
             {:fx/type :v-box
              :children
              [{:fx/type rx/value-view
                :v-box/vgrow :always
                :value (meta x)}
               (if (or (nil? x) (string? x) (not (seqable? x)))
                 {:fx/type rx/table-view
                  :items [x]
                  :v-box/vgrow :always
                  :columns [{:fn identity :header 'value}]}
                 (let [head (first x)]
                   {:fx/type rx/table-view
                    :items x
                    :v-box/vgrow :always
                    :columns (cond
                              (map? head) (for [k (keys head)] {:header k :fn #(get % k)})
                              (map-entry? head) [{:header 'key :fn key} {:header 'val :fn val}]
                              (indexed? head) (for [i (range (count head))] {:header i :fn #(nth % i)})
                              :else [{:header 'item :fn identity}])}))]})}))
It just adds a v-box around the table and a value-view with the meta. I wasn't sure about the :v-box/vgrow :always but it seems to make the two panels better behaved as their content expands and contracts?

seancorfield06:10:46

My Atom/Chlorine hot key of ctl-; v sends a Var of the current symbol so Reveal now shows docstring/arglists and file/line/col. It also helps show what content is datafiable/navigable since that's in the metadata

seancorfield06:10:39

I may yet change that to assoc in the :_obj and :_class values which I seem to recall REBL used to show in the metadata panel...?

seancorfield06:10:07

:value (assoc (meta x) :_obj x :_class (class x))}
That's a bit redundant since the auto-table-view shows the value as well, but it is nice to see the class of the object.

seancorfield06:10:28

(although it's nice to see the value and the table view side-by-side -- or one above the other -- with the class)

vlaaad06:10:56

:star-struck:

vlaaad06:10:49

That's great — you can make your own view just how you like it!