Skip to content

Latest commit

 

History

History
47 lines (40 loc) · 1.02 KB

File metadata and controls

47 lines (40 loc) · 1.02 KB
elm
dependencies
gicentre/elm-vegalite
latest
import VegaLite exposing (..)

Hello Litvis

data =
    dataFromUrl "https://gicentre.github.io/data/tiobeIndexMay2018.csv"

Top 50 programming languages according to the TIOBE index.

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

Here are the same data but displayed as horizontal bars arranged in alphabetical order:

helloLitvis : Spec
helloLitvis =
    let
        enc =
            encoding
                << position Y [ pName "language" ]
                << position X [ pName "rating", pQuant ]
    in
    toVegaLite [ data [], enc [], bar [] ]