Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justinwoo/purescript-gomtang-basic
Another wrapper for ECharts using Union to take records of subsets of allowed fields. Based off of the ideas in React-Basic.
https://github.com/justinwoo/purescript-gomtang-basic
echarts purescript
Last synced: 16 days ago
JSON representation
Another wrapper for ECharts using Union to take records of subsets of allowed fields. Based off of the ideas in React-Basic.
- Host: GitHub
- URL: https://github.com/justinwoo/purescript-gomtang-basic
- Owner: justinwoo
- License: mit
- Created: 2018-02-17T12:29:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-27T21:21:56.000Z (over 6 years ago)
- Last Synced: 2024-12-07T04:09:54.036Z (about 1 month ago)
- Topics: echarts, purescript
- Language: PureScript
- Homepage:
- Size: 7.81 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PureScript-Gomtang-Basic
Another wrapper for [ECharts](http://echarts.baidu.com/) using `Union` to take records of subsets of allowed fields. Based off of the ideas in [React-Basic](https://github.com/lumihq/purescript-react-basic).
Named for the Korean soup ["Gomtang"](https://en.wikipedia.org/wiki/Gomguk) and the Union-based approach "-basic".
![](https://i.imgur.com/qHhWz11.jpg)
More advanced uses of ECharts can be accomplished with [PureScript-ECharts](https://github.com/slamdata/purescript-echarts/).
## Example
```hs
main = do
main_
<- getElementById (ElementId "main")
<<< htmlDocumentToNonElementParentNode
=<< document
=<< window
case main_ of
Nothing ->
log "could not find 'main' element"
Just ele -> do
chart <- makeChart ele
setOption option chart
log "started"
where
option =
{ title
, xAxis
, yAxis
, series
}
title = makeTitle { text: "Bar Example" }
xAxis = makeXAxis
{ data:
[ "shirt"
, "cardigan"
, "chiffon"
, "pants"
, "heels"
, "socks"
]
}
yAxis = makeYAxis {}
series = [ seriesOption ]
seriesOption = makeBarSeries
{ name: "sales"
, data: [5.0, 20.0, 36.0, 10.0, 10.0, 20.0]
}
```Looks like this:
![](https://i.imgur.com/vvgL2lW.png)