Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from cryogenian/ready/halogen-update
Browse files Browse the repository at this point in the history
Update to new version of halogen.
  • Loading branch information
jonsterling committed Oct 29, 2015
2 parents ae26e54 + 9b50b28 commit d90f533
Show file tree
Hide file tree
Showing 16 changed files with 840 additions and 243 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
node_modules/
bower_components/
output/

/tmp/
/dist/
/output/
/coverage/
public/*.js
!public/echarts-all.js
.psci_modules
.psci
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: node_js
node_js:
- 0.12
install:
- npm install bower gulp -g
- npm install && bower install
script:
- gulp
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# purescript-halogen-echarts

Halogen integration for Echarts via the `purescript-echarts` library.


## Note

+ `purescript-echarts` library depends on `echarts` specific version (_~2.1.10_).
+ please include `echarts-all.js` file from `echarts` to built project via `script` in
your html or just concat it with your bundled js.


## To run example

```
$ gulp
$ open public/index.html
```
16 changes: 13 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "purescript-halogen-echarts",
"version": "1.0.0",
"moduleType": [
"node"
],
Expand All @@ -11,7 +10,18 @@
"output"
],
"dependencies": {
"purescript-halogen": "master",
"purescript-echarts": "*"
"purescript-halogen": "^0.5.3",
"purescript-echarts": "^0.4.0",
"purescript-halogen-css": "^0.1.1",
"purescript-datetime": "^0.9.0",
"purescript-random": "^0.2.2",
"purescript-refs": "^0.2.0",
"purescript-maps": "^0.5.2",
"purescript-transformers": "^0.8.1"
},
"devDependencies": {
"purescript-generics": "^0.6.2",
"purescript-random": "^0.2.2",
"purescript-debug": "^0.1.2"
}
}
45 changes: 45 additions & 0 deletions docs/Halogen/ECharts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Module Halogen.ECharts

#### `EChartsState`

``` purescript
type EChartsState = { option :: Maybe Option, chart :: Maybe EChart, width :: Int, height :: Int, key :: Maybe String }
```

#### `initialEChartsState`

``` purescript
initialEChartsState :: Int -> Int -> EChartsState
```

#### `EChartsQuery`

``` purescript
data EChartsQuery a
= Set Option a
| Resize a
| Refresh a
| Clear a
| Dispose a
| Init HTMLElement a
| Quit HTMLElement a
| SetHeight Int a
| SetWidth Int a
| GetOptions (Maybe Option -> a)
| GetWidth (Int -> a)
| GetHeight (Int -> a)
```

#### `EChartsEffects`

``` purescript
type EChartsEffects e = (echartInit :: ECHARTS_INIT, echartSetOption :: ECHARTS_OPTION_SET, echartDispose :: ECHARTS_DISPOSE, echartResize :: ECHARTS_RESIZE, echartRefresh :: ECHARTS_REFRESH, echartClear :: ECHARTS_CLEAR, dom :: DOM, random :: RANDOM, now :: Now, ref :: REF | e)
```

#### `echarts`

``` purescript
echarts :: forall e. Component EChartsState EChartsQuery (Aff (EChartsEffects e))
```


1 change: 0 additions & 1 deletion example/.gitignore

This file was deleted.

104 changes: 0 additions & 104 deletions example/Main.purs

This file was deleted.

10 changes: 0 additions & 10 deletions example/index.html

This file was deleted.

53 changes: 53 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"use strict"

var gulp = require("gulp"),
purescript = require("gulp-purescript"),
webpack = require("webpack-stream");

var sources = [
"src/**/*.purs",
"test/src/**/*.purs",
"bower_components/purescript-*/src/**/*.purs",
];

var foreigns = [
"src/**/*.js",
"test/src/**/*.js",
"bower_components/purescript-*/src/**/*.js"
];

gulp.task("docs", function() {
return purescript.pscDocs({
src: sources,
docgen: {
"Halogen.ECharts": "docs/Halogen/ECharts.md"
}
});
});


gulp.task("make", function() {
return purescript.psc({
src: sources,
ffi: foreigns
});
});

gulp.task("pre-bundle", ["make"], function() {
return purescript.pscBundle({
src: "output/**/*.js",
main: "Test.Main",
output: "tmp/test.js"
});
});

gulp.task("bundle", ["pre-bundle"], function() {
return gulp.src("tmp/test.js")
.pipe(webpack({
resolve: {moduleDirectories: ["node_modules"]},
output: {filename: "test.js"}
}))
.pipe(gulp.dest("public"));
});

gulp.task("default", ["bundle", "docs"]);
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "purescript-halogen-echarts",
"description": "Halogen integration for Echarts via the `purescript-echarts` library.",
"repository": {
"type": "git",
"url": "https://github.com/slamdata/purescript-halogen-echarts.git"
},
"author": "Maxim Zimaliev <[email protected]>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/slamdata/purescript-halogen-echarts/issues"
},
"homepage": "https://github.com/slamdata/purescript-halogen-echarts",
"dependencies": {
"gulp": "^3.9.0",
"gulp-purescript": "^0.7.0",
"purescript": "^0.7.5-rc.2",
"webpack-stream": "^2.1.1"
},
"devDependencies": {
"virtual-dom": "^2.1.1"
}
}
25 changes: 25 additions & 0 deletions public/echarts-all.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>
purescript-halogen-echarts examples
</title>
<script type="text/javascript" src="./echarts-all.js"></script>
<script type="text/javascript" src="./test.js"></script>
</head>
<body>
</body>
</html>
8 changes: 8 additions & 0 deletions src/Halogen/ECharts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// module Halogen.ECharts

exports.memo = {value: {}};
exports.dataset = function(node) {
return function() {
return node.dataset;
};
};
Loading

0 comments on commit d90f533

Please sign in to comment.