Aim

Make plotting in scala easy and enjoyable by wrapping up vega.

Hardness:

Very

Why?

From what I can see, scala lacks a really robust plotting library.

The Problem

After some time, I think I’m finally in a position to enumerate the real problem, which basically boils down to “visual correctness”.

Scala is an incredibly expressive language, but it seeks to enfore correctness at compile time. An axis on the left, and right side of a plot are both “correct” - however, it is likely that one of them makes significantly more “visual sense” than the other. The type system, can almost certainly not help with this.

The other place I’ve hit this in scala, is in CSS. Laminar is wonderful, but getting CSS right is a pain in the neck. The best solution I found, was LESS inside Vite. Why? Because the feedback loop is instant.

I think the same is true for visualisation. The feedback loop needs to be as short as possible. I believe this can be doen in scala, but I’m icnreasingly convinced that true-blue static typing attempts, are doomed. Primarily, because they offer no “visual correctness” guarantees - static typing for visual problems is nothing other than overhead. It’s pure cost.

Status:

The project is real and it works, but hasn’t gained traction. I can imagine reasons for this…

The next evoluation of this, I think will be structual types to improve the ergonomics of using data, and records4s to improve the ergonmics of expressing the charting.