| elm |
|
|---|
import VegaLite exposing (..)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 [] ]