Haskell library to obtain minified Flot code
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
javascript
src
.ghci
.gitignore
.travis.yml
CHANGES.txt
LICENSE
PULL_REQUEST_TEMPLATE.md Update PULL_REQUEST_TEMPLATE.md Sep 7, 2018
README.md
Setup.hs Initial version Oct 19, 2014
js-flot.cabal Update js-flot.cabal Oct 15, 2018

README.md

js-flot Hackage version Stackage version Build Status

This package bundles the minified Flot code (a jQuery plotting library) into a Haskell package, so it can be depended upon by Cabal packages. The first three components of the version number match the upstream Flot version. The package is designed to meet the redistribution requirements of downstream users (e.g. Debian). As an example:

import qualified Language.Javascript.Flot as Flot

main = do
    putStrLn $ "Flot version " ++ show Flot.version ++ " source:"
    putStrLn =<< readFile =<< Flot.file Flot.Flot

Note that Flot depends on jQuery, a Haskell version of which can be obtained from the js-jquery package.

This package installs data files containing the Flot sources, which must be available at runtime. If you want to produce an executable with no dependency on associated data files, you can use the file-embed library:

{-# LANGUAGE TemplateHaskell #-}

import Data.FileEmbed
import qualified Data.ByteString as BS
import qualified Language.Javascript.Flot as Flot
import Language.Haskell.TH.Syntax

main = print flotContents

flotContents :: BS.ByteString
flotContents = $(embedFile =<< runIO (Flot.file Flot.Flot))