If you are interested in plotting things in scala, you may find any or all of the below libraries of interest. I obviously felt strongly enough to attempt to create my own version... but YMMV and here are other attempts at the paradigm. In each case I either found they were unmaintained or didn't suit my way of working. Plotly scala in particular is probably the "standout candidate" from the below list.
All are valuable resources - this library takes bits from all of them...
A lot more developed... but not scala! - https://github.com/metasoarous/oz
Or use scalably typed and generate a typesafe facade for your scala JS library of choice.
Why this library?
I like scala. I've found it to be a wonderful experience, with, to my mind a weakness - data visualisation. I certainly feel I put in a solid "best effort" to find an existing library, and struggled with them. Also... this was fun.
From first principles
Good data visulaisation is hard. In terms of library authorship, there are two formidable problems one must overcome in order for such a library to be viable.
- Drawing on screen
It turns out, there are programs which are already amazing at doing this; browsers. When thinking about this problem, I concluded pretty quickly that my first class citizen had to be the browser. The engineering effort to recreate or even dent the two problems above is truly formiddable otherwise.
Unfortunately, this leaves us with a problem. Scala doesn't run in the browser... (a filthy lie)... but most scala takes place on the JVM. My target is a repl / interactive JVM environment, and that introduces some challenges.
It turns out, that vega/lite even publish schema. If we had a way to generate scala case classes from schema... we'd have a convienient, typesafe DSL!
What of typesafety?
Many of the libraries above set out to define a typesafe DSL. Do we need one?
When thinking about this, one has to ask, why? Typesafety is attractive because of the runtime guarantees it provides. It also comes with cost.
In data visualisation, I suspect a genuinely typesafe DSL to be a very hard problem. An axis doesn't have meaning without a scale - that's easy I hear you cry! Okay, but which part of the scale are we interested in? Is that sensible / interesting? I'm not even sure you could say before having the data available.
So I don't claim the DSL is perfect. It's as good as the vega schema. Which is pretty good. It provides abstractions which you could use to get pretty close to typesafety, for your use case.
Nothing about the DSL, saves you from having to learn vega...
... but I think you will not regret learning a declarative paradigm. The 10 minutes spent learning this library (it's absurdly simple) are sunk cost. I believe you'll quickly earn those minutes back in lovely, publishable plots!