- Notifications
You must be signed in to change notification settings - Fork16
slamdata/purescript-echarts
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Purescript bindings for Baidu'sEnterprise Charts (Echarts) charting library.
This approach drastically differs withv2.0.0.
All basic echarts function are implemented as effectful functions. They are wrapped inMonadEff typeclass and could be used not only inEff monad but inAff and effectful transformers.
Option object is constructed usingWriter monad augmented with phantom rows. I.e. there is no anyspecial type forOption,Legend orTooltip, but they areDSL PhantomRowsI wherePhantomRowsI is phantom row type.
To write a field to objects one should use function fromECharts.Commands module. Row label of this function indicates if this function could be used for building particular objects. For example, if you build something likePie series object you can use functionname because it has typeforall i. String -> DSL (name :: I|i) andPieI has thisname label in its phantom part, but you can't usesymbol because its type isforall i. Symbol -> DSL (symbol :: I|i) andPieI hasn'tsymbol label.
To run examples
npm run buildnpm run serve
Then go tolocalhost:5050
- To use this lib in your project you need to add
echartsnpm dependency to your project. - This branch isn't fully implemented yet, although it has all features that we currently use in slamdata.
Writer's log isArray (Tuple String Foreign). There are three different functions that builds sub-dsls:buildObjtakes pairs from log and writeForeigns as values to empty object;buildArrignores first part of tuple and just writeForeigns to empty array,buildSeriestakes first part of tuple and write it as"type"field to the second part (Tuple "foo" $ toForeign {a: 12} -> toForeign {"type": "foo", a: 12}) and then put it to empty array.- There are row names that differs with field names fromecharts docs. For example,echarts uses
datafield andpurescript-echartsusesitems. Other thing is that some field names collide and to fix it there are new row names:normalItemStyle,normalLabel. - In this approach one could add new type for some field value (like
PercentOrPixel)OR add command (likeleftCenter)OR add newDSLfor building foreign data (likeaddItem).
About
Purescript bindings for Baidu's Echarts library
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors11
Uh oh!
There was an error while loading.Please reload this page.