hvega: Create Vega-Lite visualizations (version 3) in Haskell.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

This is based on the elm-vegalite package (http://package.elm-lang.org/packages/gicentre/elm-vegalite/latest) by Jo Wood of the giCentre at the City University of London.


[Skip to ReadMe]

Properties

Versions0.1.0.0, 0.1.0.1, 0.1.0.3, 0.2.0.0, 0.2.1.0, 0.3.0.0, 0.3.0.1, 0.4.0.0, 0.4.1.0, 0.4.1.0, 0.4.1.1
Change logCHANGELOG.md
Dependenciesaeson (>=0.11 && <1.5), aeson-pretty (==0.8.*), base (>=4.9 && <5), bytestring, directory, filepath, hvega, text (==1.2.*), unordered-containers (==0.2.*), vector (>=0.11 && <0.13) [details]
LicenseBSD-3-Clause
Copyright2018-2019 Douglas Burke
AuthorDouglas Burke
Maintainerdburke.gw@gmail.com
CategoryGraphics
Home pagehttps://github.com/DougBurke/hvega
Bug trackerhttps://github.com/DougBurke/hvega/issues
Source repositoryhead: git clone https://github.com/DougBurke/hvega
Executablesplaytutorial
UploadedWed Sep 18 23:43:20 UTC 2019 by DouglasBurke

Modules

[Index]

Flags

NameDescriptionDefaultType
tools

Build associated tools (in general you won't need this)

DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for hvega-0.4.1.0

[back to package description]

hvega

Support the creation of Vega-Lite visualizations in Haskell. This code is released under the BSD3 license.

It is an almost-direct copy of version 2.2.1 of the Elm Vega library, which is released under a BSD3 license by Jo Wood of the giCentre at the City University of London.

Example

let cars =  dataFromUrl "https://vega.github.io/vega-datasets/data/cars.json" []

    enc = encoding
            . position X [ PName "Horsepower", PmType Quantitative ]
            . position Y [ PName "Miles_per_Gallon", PmType Quantitative ]
            . color [ MName "Origin", MmType Nominal ]

    bkg = background "rgba(0, 0, 0, 0.05)"

in toVegaLite [ bkg, cars, mark Circle [], enc [] ]

When viewed with a Vega-Lite aware viewer, the resultant plot is

Simple scatterplot

Documentation

The Elm Vega documentation can be used as a guide to using this module. The Vega-Lite Example Gallery has been converted to an IHaskell notebook Uunfortunately the plots created by VegaEmbed do not appear in the notebook when viewed with either GitHub's viewer or ipynb viewer, but things seem much better when using Jupyter Lab (rather than notebook) to create the notebooks (since Vega is natively supported in this environment). The notebooks have been re-created using Jupyter Lab (thanks to Tweag I/O's JupyterWith environment), which should make the plots appear on GitHub (you may need to reload the notebooks as I find they don't display on the first try).

The notebooks directory contains a poorly-curated set of examples and experiments with hvega.

Differences to Elm Vega

The main changes to version 2.2.1 of Elm Vega are: