Skip to content
Haskell library to obtain minified Flot code
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
javascript
src
.ghci
.gitignore
.travis.yml
CHANGES.txt
LICENSE
PULL_REQUEST_TEMPLATE.md
README.md
Setup.hs
js-flot.cabal

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))
You can’t perform that action at this time.