Clojure Inspectorλ︎
A visual browser for Clojure data using the Java UI libraries.
Require the clojure.inspector
namespace in the REPL or project namespace definitions to use the functions
inspect
for flat data structuresinspect-tree
for deeply nested / hierarchically datainspect-table
a sequence of data structures with the same shape
inspect
λ︎
View flat structures especially with non-trivial size data sets.
This example generated 10,000 random numbers. The Clojure inspector shows the values along with their index in the collection.
inspect-tree
λ︎
(inspect
{:star-wars
{:characters
{:jedi ["obiwan kenobi" "Yoda" "Master Wendoo"]
:sith ["Palpatine" "Count Dukoo"]}}})
inspect-table
λ︎
Inspect a sequence of data structures that share the same form, often found in data sets for machine learning and wider data science, eg. daily weather records.
This example generates mock data for a 20 day period for one or more locations. Each day contains the day, location and cumulative number of cases reported.
(defn mock-data-set
"Generates a set of mock data for each name
Arguments: names as strings, names used in keys
Returns: Sequence of maps, each representing confirmed cases"
[& locations]
(for [location locations
day (range 20)]
{:day day
:location location
:cases (+ (Math/pow (* day (count location)) 0.8)
(rand-int (count location)))}))
(inspector/inspect-table
(mock-data-set "England" "Scotland" "Wales" "Northern Ireland"))