Reason bindings for recharts
npm install @ahrefs/bs-rechartsThis is Bucklescript bindings for Recharts.
š§ It is not completed, we are adding bindings as we go. Doesn't follow semver at this point. š§
```
yarn add @ahrefs/bs-recharts
Add bs-recharts to bs-depenencies in your bsconfig.json!
`js`
{
/ ... /
"bs-dependencies": [
"@ahrefs/bs-recharts"
],
/ ... /
}
`re
open BsRecharts;
[@react-component]
let make = (~data) =>
margin={"top": 0, "right": 0, "bottom": 0, "left": 0}
data>
`
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(int)
| Prc(int);
...
};
module StrOrNode = {
...
type arg =
| Str(string)
| Node(ReasonReact.reactElement);
...
};
`
you will use it like this:
```
label=Str("text")
/>
label=Node(
(ReasonReact.stringToElement("text"))
)
/>
Check Recharts documentation for available props.