package melange-recharts

  1. Overview
  2. Docs
Melange bindings for recharts

Install

Dune Dependency

Authors

Maintainers

Sources

melange-recharts-4.0.3.tbz
sha256=1295e56c252d53ca85bf814404e4bc40b02ba095b33cd48cd1b44d05514bae0c
sha512=a204b818dbc3e01dd4e8ceacabc70221844592b2e7163dfc7375051b921253285a38cf502e7c2cd8c613d04ceee9270408e572b43bdae4988fc164c35adec933

Description

Melange bindings for recharts JavaScript library.

Tags

melange org:ahrefs

Published: 07 Jun 2024

README

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.

Dependencies (6)

  1. reason-react-ppx >= "0.14.0"
  2. reason-react >= "0.14.0"
  3. reason >= "3.10.0"
  4. melange >= "3.0.0"
  5. ocaml
  6. dune >= "3.8"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.