JetBrains / lets-plot-kotlin

Grammar of Graphics for Kotlin
https://lets-plot.org/kotlin/
MIT License
419 stars 36 forks source link

Usage not only `Number` as a layer `x`/`y` argument #154

Closed AndreiKingsley closed 1 year ago

AndreiKingsley commented 1 year ago

At the moment, if I want to make a constant x in some layer, that value has to be Number. Why can't I use String or datetime type?

alshan commented 1 year ago

Constants accept values of a type matching the type of correspondent aesthetic. In case of positional aesthetics this is number.

If you want to use a value belonging to your data domain, you can try to use it in mapping: geom_abc() { x=["my value"]}