Clojure Inspector

A visual browser for Clojure data using the Java UI librariesdf465x.

  • inspect for flat data structures
  • inspect-tree for deeply nested / hierarchically data
  • inspect-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.

  1. (inspector/inspect
  2. (repeatedly 10000 #(rand-int 101)))

Clojure Inspector - inspect data elements with index

inspect-tree

  1. (inspect
  2. {:starwars
  3. {:characters
  4. {:jedi ["obiwan kenobi" "Yoda" "Master Wendoo"]
  5. :sith ["Palpatine" "Count Dukoo"]}}})

Clojure - Inspector - inspect tree with hash-map

inspect-table

Inspect a sequence of data structures that share the same form, often found in data sets for machine learning and wider data scients, 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.

  1. (defn mock-data-set
  2. "Generates a set of mock data for each name
  3. Arguments: names as strings, names used in keys
  4. Returns: Sequence of maps, each representing confirmed cases"
  5. [& locations]
  6. (for [location locations
  7. day (range 20)]
  8. {:day day
  9. :location location
  10. :cases (+ (Math/pow (* day (count location)) 0.8)
  11. (rand-int (count location)))}))
  12. (inspector/inspect-table
  13. (mock-data-set "England" "Scotland" "Wales" "Northern Ireland"))

Cider Inspector - inspect table - medical cases mock data