This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from cryogenian/ready/halogen-update
Update to new version of halogen.
- Loading branch information
Showing
16 changed files
with
840 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
``` | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; | ||
}; |
Oops, something went wrong.