Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 800 Bytes

File metadata and controls

33 lines (28 loc) · 800 Bytes
elm
dependencies
gicentre/elm-vegalite
latest
import VegaLite exposing (..)

Hello Litvis

Top 5 programming languages according to the TIOBE index.

helloLitvis : Spec
helloLitvis =
    let
        data =
            dataFromColumns []
                << dataColumn "language" (strs [ "Java", "C", "C++", "Python", "C#" ])
                << dataColumn "rating" (nums [ 15.8, 13.6, 7.2, 5.8, 5.3 ])

        enc =
            encoding
                << position X
                    [ pName "language"
                    , pSort [ soByField "rating" opMean, soDescending ]
                    ]
                << position Y [ pName "rating", pQuant ]
    in
    toVegaLite [ data [], enc [], bar [] ]