Skip to content

Commit

Permalink
Merge pull request #62 from ahrefs/fix/type-defs
Browse files Browse the repository at this point in the history
Fix tooltip cursor type
  • Loading branch information
bryanthomaschen authored Dec 6, 2024
2 parents 62dfc3f + 4c11a57 commit 36bf79a
Show file tree
Hide file tree
Showing 27 changed files with 285 additions and 403 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.0.2

- change Tooltip.cursor Obj type to open object type

## 5.0.1

- update `recharts` to `2.14.1`
Expand Down
4 changes: 2 additions & 2 deletions example/Example.re
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ open Recharts;

[@react.component]
let make = (~data) =>
<ResponsiveContainer height=(Px(200.)) width=(Px(300.))>
<ResponsiveContainer height={Px(200.)} width={Px(300.)}>
<BarChart
barCategoryGap=(Px(1.))
barCategoryGap={Px(1.)}
margin={"top": 0, "right": 0, "bottom": 0, "left": 0}
data>
<Bar name="Some bar" dataKey="pv" fill="#2078b4" stackId="a" />
Expand Down
20 changes: 9 additions & 11 deletions src/Area.re
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ external make:
~activeDot: 'activeDot=?,
~animationBegin: int=?,
~animationDuration: int=?,
~animationEasing:
[@mel.string] [
| `ease
| [@mel.as "ease-in"] `easeIn
| [@mel.as "ease-out"] `easeOut
| [@mel.as "ease-in-out"] `easeInOut
| `linear
]
=?,
~animationEasing: [@mel.string] [
| `ease
| [@mel.as "ease-in"] `easeIn
| [@mel.as "ease-out"] `easeOut
| [@mel.as "ease-in-out"] `easeInOut
| `linear
]
=?,
~baseLine: 'baseLine=?,
~connectNulls: bool=?,
~hide: bool=?,
Expand All @@ -33,8 +32,7 @@ external make:
~name: string=?,
~onClick: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseDown: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter:
(Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseLeave: (Js.t({..}), React.Event.Mouse.t) => unit=?,
~onMouseMove: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseOut: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
Expand Down
3 changes: 1 addition & 2 deletions src/AreaChart.re
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ external make:
~onClick: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseUp: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseDown: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter:
(Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseLeave: (Js.t({..}), React.Event.Mouse.t) => unit=?,
~onMouseMove: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~stackOffset: stackOffset=?,
Expand Down
64 changes: 39 additions & 25 deletions src/Bar.re
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ external make:
(
~animationBegin: int=?,
~animationDuration: int=?,
~animationEasing:
[@mel.string] [
| `ease
| [@mel.as "ease-in"] `easeIn
| [@mel.as "ease-out"] `easeOut
| [@mel.as "ease-in-out"] `easeInOut
| `linear
]
=?,
~animationEasing: [@mel.string] [
| `ease
| [@mel.as "ease-in"] `easeIn
| [@mel.as "ease-out"] `easeOut
| [@mel.as "ease-in-out"] `easeInOut
| `linear
]
=?,
~background: 'background=?,
~barSize: int=?,
~className: string=?,
Expand All @@ -30,22 +29,37 @@ external make:
~maxBarSize: int=?,
~minPointSize: int=?,
~name: string=?,
~onClick:
(Js.t({.. "payload": 'dataItem}), int, React.Event.Mouse.t) => unit=?,
~onMouseDown:
(Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) => unit=?,
~onMouseEnter:
(Js.t({.. "payload": 'dataItem}), int, React.Event.Mouse.t) => unit=?,
~onMouseLeave:
(Js.t({.. "payload": 'dataItem}), int, React.Event.Mouse.t) => unit=?,
~onMouseMove:
(Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) => unit=?,
~onMouseOut:
(Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) => unit=?,
~onMouseOver:
(Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) => unit=?,
~onMouseUp:
(Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) => unit=?,
~onClick: (Js.t({.. "payload": 'dataItem}), int, React.Event.Mouse.t) =>
unit
=?,
~onMouseDown: (Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) =>
unit
=?,
~onMouseEnter: (
Js.t({.. "payload": 'dataItem}),
int,
React.Event.Mouse.t
) =>
unit
=?,
~onMouseLeave: (
Js.t({.. "payload": 'dataItem}),
int,
React.Event.Mouse.t
) =>
unit
=?,
~onMouseMove: (Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) =>
unit
=?,
~onMouseOut: (Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) =>
unit
=?,
~onMouseOver: (Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) =>
unit
=?,
~onMouseUp: (Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) => unit
=?,
~radius: array(int)=?,
~shape: 'shape=?,
~stackId: string=?,
Expand Down
3 changes: 1 addition & 2 deletions src/BarChart.re
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ external make:
~onClick: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseUp: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseDown: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter:
(Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseLeave: (Js.t({..}), React.Event.Mouse.t) => unit=?,
~onMouseMove: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~reverseStackOrder: bool=?,
Expand Down
3 changes: 2 additions & 1 deletion src/CartesianAxis.re
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ external make:
React.element =
"CartesianAxis";

let makeProps = (~interval=?) => makeProps(~interval=?interval->AxisInterval.encodeOpt);
let makeProps = (~interval=?) =>
makeProps(~interval=?interval->AxisInterval.encodeOpt);
3 changes: 1 addition & 2 deletions src/ComposedChart.re
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ external make:
~onClick: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseUp: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseDown: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter:
(Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseLeave: (Js.t({..}), React.Event.Mouse.t) => unit=?,
~onMouseMove: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~reverseStackOrder: bool=?,
Expand Down
3 changes: 1 addition & 2 deletions src/Dot.re
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ external make:
~fill: string,
~onClick: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseDown: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter:
(Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseLeave: (Js.t({..}), React.Event.Mouse.t) => unit=?,
~onMouseMove: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseOut: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
Expand Down
44 changes: 15 additions & 29 deletions src/Legend.re
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,37 @@ open Utils;
[@mel.module "recharts"] [@react.component]
external make:
(
~align:
[
| `left
| `center
| `right
]
=?,
~align: [ | `left | `center | `right]=?,
~chartHeight: int=?,
~chartWidth: int=?,
~content: 'content=?,
~className: string=?,
~height: int=?,
~iconSize: int=?,
~iconType:
[
| `line
| `square
| `rect
| `circle
| `cross
| `diamond
| `star
| `triangle
| `wye
]
=?,
~iconType: [
| `line
| `square
| `rect
| `circle
| `cross
| `diamond
| `star
| `triangle
| `wye
]
=?,
~layout: layout=?,
~margin: margin=?,
~onClick: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseDown: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter:
(Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseLeave: (Js.t({..}), React.Event.Mouse.t) => unit=?,
~onMouseMove: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseOut: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseOver: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseUp: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~payload: array(Js.t({..}))=?,
~verticalAlign:
[
| `top
| `middle
| `bottom
]
=?,
~verticalAlign: [ | `top | `middle | `bottom]=?,
~width: int=?,
~wrapperStyle: Js.t({..})=?
) =>
Expand Down
20 changes: 9 additions & 11 deletions src/Line.re
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ external make:
~activeDot: 'activeDot=?,
~animationBegin: int=?,
~animationDuration: int=?,
~animationEasing:
[@mel.string] [
| `ease
| [@mel.as "ease-in"] `easeIn
| [@mel.as "ease-out"] `easeOut
| [@mel.as "ease-in-out"] `easeInOut
| `linear
]
=?,
~animationEasing: [@mel.string] [
| `ease
| [@mel.as "ease-in"] `easeIn
| [@mel.as "ease-out"] `easeOut
| [@mel.as "ease-in-out"] `easeInOut
| `linear
]
=?,
~className: string=?,
~connectNulls: bool=?,
~hide: bool=?,
Expand All @@ -31,8 +30,7 @@ external make:
~name: string=?,
~onClick: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseDown: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter:
(Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseLeave: (Js.t({..}), React.Event.Mouse.t) => unit=?,
~onMouseMove: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseOut: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
Expand Down
3 changes: 1 addition & 2 deletions src/LineChart.re
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ external make:
~onClick: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseUp: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseDown: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter:
(Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseEnter: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~onMouseLeave: (Js.t({..}), React.Event.Mouse.t) => unit=?,
~onMouseMove: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?,
~syncId: string=?,
Expand Down
Loading

0 comments on commit 36bf79a

Please sign in to comment.