Skip to content

Commit

Permalink
js-flot -> js-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
jonascarpay committed Nov 9, 2020
1 parent 420f06c commit f1221d1
Show file tree
Hide file tree
Showing 31 changed files with 156 additions and 288 deletions.
6 changes: 0 additions & 6 deletions .ghci

This file was deleted.

8 changes: 3 additions & 5 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
Changelog for js-flot
Changelog for js-chart

Don't test with GHC 7.4 to 7.8
Add a file-embed example
0.8.3, released 2014-11-10
Initial version
2.9.4, released TODO
Initial fork of js-flot
5 changes: 3 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Copyright Neil Mitchell 2014-2020.
Copyright (c) 2007-2014 IOLA and Ole Laursen
Copyright Jonas Carpay 2020
Copyright Neil Mitchell 2020
Copyright (c) 2020 Chart.js contributors

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
5 changes: 0 additions & 5 deletions PULL_REQUEST_TEMPLATE.md

This file was deleted.

32 changes: 14 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
# js-flot [![Hackage version](https://img.shields.io/hackage/v/js-flot.svg?label=Hackage)](https://hackage.haskell.org/package/js-flot) [![Stackage version](https://www.stackage.org/package/js-flot/badge/nightly?label=Stackage)](https://www.stackage.org/package/js-flot) [![Build status](https://img.shields.io/travis/ndmitchell/js-flot/master.svg?label=Build)](https://travis-ci.org/ndmitchell/js-flot)
# js-chart [![Hackage version](https://img.shields.io/hackage/v/js-chart.svg?label=Hackage)](https://hackage.haskell.org/package/js-chart) [![Stackage version](https://www.stackage.org/package/js-chart/badge/nightly?label=Stackage)](https://www.stackage.org/package/js-chart) [![Build status](https://img.shields.io/travis/jonascarpay/js-chart/master.svg?label=Build)](https://travis-ci.org/jonascarpay/js-chart)

This package bundles the minified [Flot](http://www.flotcharts.org/) 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:
This package bundles the minified [http://www.chartjs.org/](`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 [https://hackage.haskell.org/package/js-flot](js-flot) using `chart.js` instead of `flot`.

```haskell
import qualified Language.Javascript.Flot as Flot
import qualified Language.Javascript.Chart as Chart

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

Note that Flot depends on jQuery, a Haskell version of which can be obtained
from the [`js-jquery` package](https://github.com/ndmitchell/js-jquery#readme).

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`](https://hackage.haskell.org/package/file-embed) library:
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`](https://hackage.haskell.org/package/file-embed) library:

```haskell
{-# LANGUAGE TemplateHaskell #-}

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

main = print flotContents
main = print chartContents

flotContents :: BS.ByteString
flotContents = $(embedFile =<< runIO (Flot.file Flot.Flot))
chartContents :: BS.ByteString
chartContents = $(embedFile =<< runIO (Chart.file Chart.Chart))
```
7 changes: 7 additions & 0 deletions javascript/Chart.bundle.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions javascript/Chart.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions javascript/Chart.min.js

Large diffs are not rendered by default.

Binary file added javascript/chart.js-2.9.4.tgz
Binary file not shown.
Binary file removed javascript/flot-0.8.3.zip
Binary file not shown.
7 changes: 0 additions & 7 deletions javascript/jquery.flot.canvas.min.js

This file was deleted.

7 changes: 0 additions & 7 deletions javascript/jquery.flot.categories.min.js

This file was deleted.

7 changes: 0 additions & 7 deletions javascript/jquery.flot.crosshair.min.js

This file was deleted.

7 changes: 0 additions & 7 deletions javascript/jquery.flot.errorbars.min.js

This file was deleted.

Loading

0 comments on commit f1221d1

Please sign in to comment.