Given the numerous ways you could have set up that table don't think I could help. If it's not too late, you could use a prebuilt table?
If your using react "Table API - Material-UI" https://material-ui.com/api/table/
@qmstuart use pure flex-box CSS, no extra libs. The React Native guide is the best in terms of clarity and conciseness that I’ve found; it finally allowed me to “get” flex-box; I still refer to it very frequently; I realize you’re probably not doing this in RN, but all the flex-box rules should work identically in the browser (with the one note that the default flex-direction is different in RN) https://reactnative.dev/docs/flexbox
The nice part of this guide is that it’s structured in order of importance; I.e. make sure you understand :justifyContent and :alignItems first
What methods and tools do people use to explore medium size clojure data (small enough to fit in memory, large enough to be unwieldy for pprint)? Some options I can think of: • portal • REBL • reveal • graphviz • pprint • treemaps • foldable/collapsible trees
oh I should try that!
It's one of those "I don't know how I lived without it until now" things
You can even inspect opaque reified objects and see all the values they close over
I still like this oldie https://github.com/timmolderez/inspector-jay
Usually I output to a .edn
file and inspect it programmatically (with bb
, jet
or just in a JVM REPL)
@borkdude, are there any typical patterns you use when you programmatically inspect (eg. keys, vals, some other common functions)? I do use the repl to programmatically inspect, but it can be annoying when you try to look at a value and get a mountain of text.
I use keys
a lot.
Part of the reason I'm asking is that I'm considering building better tools for this use case.
Note that there is also *print-length*
and *print-level*
Although that doesn't prevent printing long strings :/
and there are also some data shapes that circumvent those types of restrictions (eg. a 2d array of 10x10 elements)
(subs (str x) 0 10)
;)
(and then hope you don't get an NPE)
I have:
(defn truncate [s n]
(subs s 0 (min (count s) n)))
yeah, but I'm usually too lazy to type that first ;)
As part of trying to upgrade my work flow and tooling, I have a project that exposes a dev
namespace where I can put dev utlities. eg.
(require 'dev)
(dev/truncate s 20)
And I have a :dev alias that adds the project to my classpath.Isn't this what people use the 'user
namespace for? I've never really used it as such though
oh but you add a lib, yeah, makes sense
yea, I guess I could have my dev project add the utilities to 'user
. still experimenting.
You could be very evil and intern those vars into clojure.core
which is how some tools achieve "injections"
so then they are available in every ns
it can be hard to forget about deleting them before deploying etc probably
although clj-kondo will warn you that its an unknown var
yea, I've thought about that. having a very short ns is also pretty close.
A +1 for Reveal in general. pprint
if I need it in logging.
I often just sit at the repl with (def x some-big-data)
and build a big arrow expression
(-> x :foo keys)
(-> x :foo :bar type)
(-> x :foo :bar first)
etc
Reveal