Fork me on GitHub
#data-science
<
2023-01-05
>
SK16:01:48

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.

otfrom16:01:20

Sounds like a job for #C035GRLJEP8 ?

4
Rupert (Sevva/All Street)16:01:50

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.

Carsten Behring17:01:51

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

Rupert (Sevva/All Street)17:01:58

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).

jumar18:01:34

And maybe portal could be another option

stevej18:01:00

haven't tried it yet but looks interesting

SK18:01:23

thanks all!

SK18:01:31

Will definitely check out clerk

SK18:01:45

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..

Rupert (Sevva/All Street)18:01:36

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 .

Carsten Behring16:01:54

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

metasoarous01:01:36

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.

👍 2
metasoarous01:01:18

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.

👍 2
Carsten Behring15:01:22

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

👍 4