This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-18
Channels
- # announcements (19)
- # babashka (30)
- # beginners (51)
- # biff (12)
- # calva (20)
- # cider (27)
- # clara (20)
- # clj-kondo (19)
- # clojure (128)
- # clojure-canada (1)
- # clojure-dev (5)
- # clojure-europe (29)
- # clojure-nl (1)
- # clojure-norway (48)
- # clojure-uk (5)
- # clojurescript (6)
- # clr (37)
- # core-async (17)
- # cursive (2)
- # data-oriented-programming (2)
- # datahike (1)
- # datomic (5)
- # emacs (22)
- # exercism (1)
- # funcool (17)
- # humbleui (15)
- # jobs (1)
- # malli (44)
- # off-topic (11)
- # podcasts-discuss (1)
- # pomegranate (1)
- # react (1)
- # remote-jobs (1)
- # shadow-cljs (25)
- # tools-build (12)
- # tools-deps (70)
- # xtdb (24)
say I have a vector of maps, could cider inspector print them as a table? (possibly utilizing clojure.pprint/print-table)
there are fancy external tools that hook into tap>
but that means I have to leave to look at it
I like that inspector shows large vectors as paged, but sometimes a table would be good and it could even allow selection of columns
So you want to see everything at once? That would be cool especially for smaller collections of homogeneous maps with not so many keys Having an option to change “viewers” ala Portal would be nice. My ultimate wish is to be able to draw some charts, like with vega lite, without leaving emacs
When it comes to tabular data and filtering, aggregations, etc. we could draw some inspiration from tools like Visidata
my elisp fu might be a little rusty, but I could try to hack something if I know where to start
as emacs can show images, charting would definitely be doable, but that requires dependencies on the clojure side
ok, I took a stab at orchard.inspect/inspect
multimethod and while you can quite easily patch that to use table printing for a collection of maps… that doesn’t keep track of the values, would need to split that by lines and then output that like the emacs side needs it
I hacked together a variant of orchard.inspect/render-indexed-values
that tracks the values so that you can drill down
but to be really useful, it would need to have support on the cider side to switch between table mode and regular mode, and ideally selecting the columns to show
Exactly this: https://clojurians.slack.com/archives/C0617A8PQ/p1674061903017969?thread_ts=1674045609.011549&cid=C0617A8PQ But the experiment looks promising 🙂
@U07SQTAEM had a Clerk view working inside of emacs, maybe someone has the link handy
If you want to be able to visualize clojure data as various kinds of graphs inside emacs without adding any deps, consider:
https://github.com/applied-science/emacs-vega-view
It's also possible to open Clerk's front-end with *xwidget*-*webkit*-browse-url
(assuming you've built your emacs with support). Using Clerk in your project does involve a dev dep, but that might change in the next few months 😉
I played a lot with cider-inspector
vs Clerk.
Given the multitude of potential non text formats, I can hardly see how cider-inspector
could be improved to render "them all ". The table-format you ask for is just one example.
vega-lite an other.
Maybe cider-inspector
could get a "send-to-external-tool" feature, where it would send on key press the current sub-data structure to a user defined EmacsLisp/Clojure function, which could then open the data with Clerk while asking for the viewer to use...
Similar to the way we can customize which clojure function to use for "pretty-print".
@U07SQTAEM thanks a ton for sharing the vega-view package! I've been looking for something like this for a very long time.
vega looks nice, and if we can view charts inside emacs that is cool… but I still would want to keep the inspector drill down stuff, so launching an external tool is not quite the same
I agree with that - the inspector is already great but it could be become even better for quick ad-hoc data exploration.
I "live" as well in the inspector. It is kind of my "standard way" to evaluate expression in Cider. But from time to time I would wish I could "branch" out of the inspector on a certain level and render the current data in a "rich interface". I think this should be "rendered outside of Emacs". (due to the requirement of "full html compatible") With Clerk we have now a tool which can render rich data structures into html. Even support viewer plugins and complex data viewers based on JavaScript. The combination of the 2 would be fantastic. The shortest way to this might then be to extend the cider inspector, so that it can call on keypress a user supplied function with the "current" detail of the data structure.
An the original request of @U11SJ6Q0K would then be solved by using Clerk for render tables (= vector-of-maps) into html.
@U11SJ6Q0K At the end of this
https://clojurians.slack.com/archives/C0617A8PQ/p1674493870044519?thread_ts=1674486881.210099&cid=C0617A8PQ
is some EmacsLisp code which solves your original problem to a large extend as well.
You would need to "leave" Emacs, as Clerk renders in Browser..
Unless you have *xwidget*-*webkit*-browse-url
working.
Maybe we could start a "clerk" mode, just for having a place to collect this functions.