This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-05
Channels
- # announcements (1)
- # babashka (61)
- # babashka-sci-dev (1)
- # beginners (54)
- # biff (17)
- # cider (4)
- # circleci (1)
- # clj-commons (39)
- # clj-kondo (26)
- # cljdoc (40)
- # clojure (41)
- # clojure-europe (32)
- # clojure-norway (4)
- # clojure-portugal (1)
- # clojure-uk (2)
- # clojurescript (59)
- # clr (69)
- # conjure (7)
- # cursive (22)
- # data-science (16)
- # datalevin (1)
- # datomic (19)
- # docker (31)
- # funcool (1)
- # honeysql (6)
- # hoplon (1)
- # hyperfiddle (41)
- # introduce-yourself (1)
- # juxt (2)
- # leiningen (5)
- # nbb (14)
- # nextjournal (38)
- # off-topic (47)
- # polylith (2)
- # rdf (5)
- # re-frame (4)
- # reitit (27)
- # releases (6)
- # scittle (10)
- # shadow-cljs (24)
- # sql (11)
- # squint (1)
- # tools-build (33)
- # tree-sitter (4)
- # vim (39)
hi! which clojure based notebook is the easiest to use? My use cases are mainly that I have an SQL query that I transform with some clojure code, and I'd like to display a line graph and similar simple stuff like displaying a table I have as a vector of maps, etc.
Unlike Python. where users often use something like Zeplin notebooks - you can get a lot of value in saving your exploration code in a Clojure Namespace and sending it to the REPL. This makes the step of going from exploration code to production application/library much quicker compared to Notebooks. With this approach you can pick any combinations of library you wish for charting and tables etc (not just the ones that come bundled with the Notebook Framework). As @U0525KG62 mentioned Clerk is a potentially good option too.
The disadvantage of the 'clojure ns only' is that you cannot see easely several rich outputs (plots , tables) at the same time. If you need this, I would as well suggest #C035GRLJEP8
Just to be clear - that REPL does not constrain you to text. From the REPL you can call any Clojure library (to show Swing or JavaFX windows, to generate image files, PDFs, SVGs or to launch a web server and display hiccup etc and even to launch clerk
).
I obviously thought about using a REPL, but I have not found any, that both has (a) autocomplete and code-awareness (b) able to display graphics, tables inside the REPL. Sure I can display stuff in a browser or generate a PDF, but that slows down the whole process..
Most Clojure IDEs (emacs, VS Code, Intellij) have autocomplete, but may not have table rendering.
You can setup web browser (and pdf/image viewers) to auto reload content when the data changes so you can have IDE + browser/Image Viewer/Swing App open side by side with no slow down.
Many Notebooks will have a built in Table Viewer - but they are unlikely to have all the features of, say, excel or https://github.com/SparkFund/google-apps-clj - so sometimes it's better to send data from REPL to a spreadsheet for deeper analysis (slicing/dicing/pivoting/highlighting/custom charts).
For small + narrow datasets - clojure has built in clojure.pprint/print-table
.
The standard Clojure REPL can only show text , but supports any data. Any graphical tool supports rich output only for certain data. So depends what precisely you want to render as non-text, one or the other might be more suitable
In addition to all the tools above, you can also try out http://github.com/metasoarous/oz. Like clerk, you can use a namespace of clojure code as a notebook (with some different design decisions), but you can also use the view!
function if you want to just use the REPL to look at one graph at a time in a browser window, so it's quite flexible.
Regardless, a lot of these tools support vega-lite and or vega, which is a great declarative data specification for dataviz which meshes well with a lot of the Clojure philosophy, and so has seen considerable uptake in the community, and is thus quite portable between tools and worth becoming familiar with.
A good starting point for vega lite is the vega lite gallery in "Clojure syntax". So copy/paste into a clj file just works: https://github.clerk.garden/behrica/vl-galery