js-chart: Obtain minified chart.js code

[ javascript, library, mit ] [ Propose Tags ]

This package bundles the minified chart.js code into a Haskell package, so it can be depended upon by Cabal packages. The first three components of the version number match the upstream chart.js version. The package is designed to meet the redistribution requirements of downstream users (e.g. Debian). This package is a fork of js-flot using chart.js instead of flot.


[Skip to Readme]
Versions [faq] 2.9.4, 2.9.4.1
Change log CHANGELOG.md
Dependencies base (==4.*) [details]
License MIT
Copyright Jonas Carpay 2020, Neil Mitchell 2014-2020, Chart.js contributors 2020
Author Jonas Carpay <jonascarpay@gmail.com>
Maintainer Jonas Carpay <jonascarpay@gmail.com>
Category Javascript
Home page https://github.com/jonascarpay/js-chart#readme
Bug tracker https://github.com/jonascarpay/js-chart/issues
Source repo head: git clone https://github.com/jonascarpay/js-chart.git
Uploaded by jonascarpay at 2020-11-10T14:39:42Z
Distributions Arch:2.9.4.1, NixOS:2.9.4.1
Downloads 2289 total (527 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-11-10 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for js-chart-2.9.4.1

[back to package description]

js-chart Hackage version Stackage version Build status

This package bundles the minified http://www.chartjs.org/ code into a Haskell package, so it can be depended upon by Cabal packages. The first three components of the version number match the upstream chart.js version. The package is designed to meet the redistribution requirements of downstream users (e.g. Debian). This package is a fork of https://hackage.haskell.org/package/js-flot using chart.js instead of flot.

import qualified Language.Javascript.Chart as Chart

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

This package installs data files containing the chart.js 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.Chart as Chart
import Language.Haskell.TH.Syntax

main = print chartContents

chartContents :: BS.ByteString
chartContents = $(embedFile =<< runIO (Chart.file Chart.Chart))