package melange-recharts

  1. Overview
  2. Docs
Melange bindings for recharts

Install

Dune Dependency

Authors

Maintainers

Sources

melange-recharts-4.0.1.tbz
sha256=26aa05ee0e74a1a1434260aad6589b2e723330b4fa0cd6af1f35b265f2d94ab2
sha512=86851b39d8a1b10d15cae11ce79ab4ee78d7ce3a0478e8bbe26b07f0fe998421932673c4ee142552bfdaa2ad0bba68ab4c86539755b8093dfa0629c579553964

README.md.html

melange-recharts

These are the Melange bindings for Recharts. 🚧 It is not completed, we are adding bindings as we go. Doesn't follow semver at this point. 🚧

Install

Install opam package manager.

Then:

opam install melange-recharts

The bindings support the version ^2.1.12 of recharts npm package, which should be installed separately:

  "dependencies": {
    "recharts": "^2.1.12"
  }

Setup

Add melange-recharts to the libraries in your dune file:

; ...
  (libraries melange-recharts)
; ...

Usage Example

See Example.re;

Helpers

Some of polymorphic params are represented as a variant, list below:

module AxisInterval = {
  ...
  type arg =
    | PreserveStart
    | PreserveEnd
    | PreserveStartEnd
    | Num(int);
  ...
};

module PxOrPrc = {
  ...
  type arg =
    | Px(float)
    | Prc(float);
  ...
};

module StrOrNode = {
  ...
  type arg =
    | Str(string)
    | Node(ReasonReact.reactElement);
  ...
};

you will use it like this:

<XAxis
  interval=PreserveStart
  label=Str("text")
/>
<XAxis
  interval=Num(12)
  label=Node(
    <span>
      (ReasonReact.stringToElement("text"))
    </span>
  )
/>

Check Recharts documentation for available props.

OCaml

Innovation. Community. Security.