Skip to content
forked from eerohele/tab

A tool for tabulating Clojure collections.

Notifications You must be signed in to change notification settings

borkdude/eerohele-tab

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tab

Tab turns Clojure data structures into tables.

Screenshot 2023-01-17 at 21 05 06

Note Tab is in alpha. While in alpha, breaking changes can happen.

Rationale

Tab's primary aim is to help Clojure programmers make sense of data.

Most interesting Clojure values are maps or seqs of maps. When small, pretty-printing is an adequate tool for inspecting such values. When they get to medium size (like, say, your typical Ring request map), you're better off reaching for something else.

Tab aims to be that something else.

Differences to similar tools

  • Tab only shows you one value at a time.
  • Tab datafies (via clojure.datafy/datafy) values you give it.
  • Tab aims to be useful without forcing you to choose between different viewers (table, tree, etc).
  • Tab has no dependencies.

Try

Given that you have the Clojure CLI installed, on the command line, run:

clj -Sdeps '{:deps {io.github.eerohele/tab {:git/url "https://github.com/eerohele/tab.git" :git/sha "715d24e5276887533006616685833dc2d5781524"}}}'

Then, in the REPL:

user=> (require 'tab.auto)
nil
user=> (tap> BigInteger)
true

Then, bask in the glory of the table that appears in your browser. If a tabulated BigInteger doesn't do it for you, there are more examples available.

See the user manual for instructions of use.

To stop Tab:

user=> (tab.auto/halt)

The tab.auto namespace is the easiest way to run Tab. The tab.api namespace exposes the API proper.

API

user=> (require '[tab.api :as tab])
nil
user=> (doc tab/run)
...
user=> (doc tab/tab>)
...
user=> (doc tab/address)
...
user=> (doc tab/halt)
...

User manual

  • Click - to collapse a node
  • Click + to expand a node
  • Press Alt and click - or + to expand or collapse all nodes underneath a node

Examples

For more examples on what Tab can do, see repl/demo/intro.repl.

Note To run through all the examples, you must use the add-lib3 branch of tools.deps.

Features

Limitations

  • Can only make tables.
  • Likely to die if given a very large input.
  • Eager; will blow up if you give it an infinite seq.
  • Requires a modern browser to look good. If your browser supports backdrop-filter, you should be good.
  • Might not work with Clojure versions older than 1.10.2

Inspiration

Prior art / superior alternatives

Acknowledgements

About

A tool for tabulating Clojure collections.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages

  • Clojure 87.5%
  • CSS 7.8%
  • JavaScript 4.5%
  • Just 0.2%