Giter Site home page Giter Site logo

purescript-echarts's Introduction

purescript-echarts

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

Latest release Build status

API

This approach drastically differs with v2.0.0.

All basic echarts function are implemented as effectful functions. They are wrapped in MonadEff typeclass and could be used not only in Eff monad but in Aff and effectful transformers.

Option object is constructed using Writer monad augmented with phantom rows. I.e. there is no any special type for Option, Legend or Tooltip, but they are DSL PhantomRowsI where PhantomRowsI is phantom row type.

To write a field to objects one should use function from ECharts.Commands module. Row label of this function indicates if this function could be used for building particular objects. For example, if you build something like Pie series object you can use function name because it has type forall i. String -> DSL (name :: I|i) and PieI has this name label in its phantom part, but you can't use symbol because its type is forall i. Symbol -> DSL (symbol :: I|i) and PieI hasn't symbol label.

Examples

To run examples

npm run build
npm run serve

Then go to localhost:5050

Notes

  • To use this lib in your project you need to add echarts 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 is Array (Tuple String Foreign). There are three different functions that builds sub-dsls: buildObj takes pairs from log and write Foreigns as values to empty object; buildArr ignores first part of tuple and just write Foreigns 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 from echarts docs. For example, echarts uses data field and purescript-echarts uses items. 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 (like leftCenter) OR add new DSL for building foreign data (like addItem).

purescript-echarts's People

Contributors

cryogenian avatar garyb avatar jdegoes avatar safareli avatar shujuwen2013 avatar natefaubion avatar jacereda avatar justinwoo avatar jonsterling avatar fponticelli avatar paf31 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.