Hello, is there any way to clear the reveal the data in repl windows?
Not yet. Vlad has said he's considering that for a future version.
today I freezed it 🙂
so, clean buffer is very important
Yeah yeah, that's coming
@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.
(easy mod to display metadata over the table-view... ok, satisfied now 🙂 )
Thank you for talking time to provide feedback, Sean! Can you share your metadata table mod so I can add it to reveal example?
(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?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
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...?
: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.(although it's nice to see the value and the table view side-by-side -- or one above the other -- with the class)
:star-struck:
That's great — you can make your own view just how you like it!