package melange-recharts
Melange bindings for recharts
Install
Dune Dependency
Authors
Maintainers
Sources
melange-recharts-4.0.0.tbz
sha256=644be0eb66ad09460efaf6e045034276b7a8f5c0714c3e6a82e8067ebcefeb50
sha512=8469cccee493f590df6b6450c496527581d4206bb4aac5a9715ec9532808b4d1cdce0f36539b4592ed5040c3ebfd03e75952c37410e89f4c4eb6480d950875ab
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 pin add melange-recharts.dev git+https://github.com/ahrefs/melange-recharts.git#master
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.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>