Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Purescript bindings for Baidu's Echarts library

NotificationsYou must be signed in to change notification settings

slamdata/purescript-echarts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purescript bindings for Baidu'sEnterprise Charts (Echarts) charting library.

Latest releaseBuild status

API

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.

Examples

To run examples

npm run buildnpm run serve

Then go tolocalhost:5050

Notes

  • To use this lib in your project you need to addecharts npm 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:buildObj takes pairs from log and writeForeigns as values to empty object;buildArr ignores first part of tuple and just writeForeigns to empty array,buildSeries takes 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 usesdata field andpurescript-echarts usesitems. 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 (likePercentOrPixel)OR add command (likeleftCenter)OR add newDSL for building foreign data (likeaddItem).

About

Purescript bindings for Baidu's Echarts library

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors11


[8]ページ先頭

©2009-2025 Movatter.jp