diff --git a/CHANGES.md b/CHANGES.md index 9fc9d35..5025821 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +## 4.0.7 (2024-11-23) + +- add `payload` to `Pie` and `Bar` event handler +- add `style` to `XAxis` and `YAxis` + ## 4.0.6 (2024-10-19) - add `strokeOpacity` to `Line` diff --git a/src/Area.re b/src/Area.re index 0c07bac..728e3b6 100644 --- a/src/Area.re +++ b/src/Area.re @@ -8,14 +8,15 @@ 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=?, @@ -32,7 +33,8 @@ 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=?, diff --git a/src/AreaChart.re b/src/AreaChart.re index 1fdda96..362ae87 100644 --- a/src/AreaChart.re +++ b/src/AreaChart.re @@ -14,7 +14,8 @@ 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=?, diff --git a/src/Bar.re b/src/Bar.re index 2cdffc3..0ae8d5d 100644 --- a/src/Bar.re +++ b/src/Bar.re @@ -6,14 +6,15 @@ 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=?, @@ -29,14 +30,22 @@ external make: ~maxBarSize: int=?, ~minPointSize: int=?, ~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=?, - ~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=?, + ~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=?, diff --git a/src/BarChart.re b/src/BarChart.re index 59acb28..43fab2d 100644 --- a/src/BarChart.re +++ b/src/BarChart.re @@ -17,7 +17,8 @@ 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=?, @@ -30,4 +31,7 @@ external make: "BarChart"; let makeProps = (~barCategoryGap=?, ~barGap=?) => - makeProps(~barCategoryGap=?barCategoryGap->PxOrPrc.encodeOpt, ~barGap=?barGap->PxOrPrc.encodeOpt); + makeProps( + ~barCategoryGap=?barCategoryGap->PxOrPrc.encodeOpt, + ~barGap=?barGap->PxOrPrc.encodeOpt, + ); diff --git a/src/ComposedChart.re b/src/ComposedChart.re index bdac4d9..bcb882d 100644 --- a/src/ComposedChart.re +++ b/src/ComposedChart.re @@ -16,7 +16,8 @@ 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=?, @@ -29,4 +30,7 @@ external make: "ComposedChart"; let makeProps = (~barCategoryGap=?, ~barGap=?) => - makeProps(~barCategoryGap=?barCategoryGap->PxOrPrc.encodeOpt, ~barGap=?barGap->PxOrPrc.encodeOpt); + makeProps( + ~barCategoryGap=?barCategoryGap->PxOrPrc.encodeOpt, + ~barGap=?barGap->PxOrPrc.encodeOpt, + ); diff --git a/src/Dot.re b/src/Dot.re index e6d3057..438cd56 100644 --- a/src/Dot.re +++ b/src/Dot.re @@ -9,7 +9,8 @@ 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=?, diff --git a/src/Legend.re b/src/Legend.re index 23a0af7..2da2009 100644 --- a/src/Legend.re +++ b/src/Legend.re @@ -4,26 +4,51 @@ 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({..})=? ) => diff --git a/src/Line.re b/src/Line.re index 3f7aba6..fe41999 100644 --- a/src/Line.re +++ b/src/Line.re @@ -8,14 +8,15 @@ 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=?, @@ -30,7 +31,8 @@ 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=?, diff --git a/src/LineChart.re b/src/LineChart.re index f559c6c..0db7dbb 100644 --- a/src/LineChart.re +++ b/src/LineChart.re @@ -13,7 +13,8 @@ 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=?, diff --git a/src/Pie.re b/src/Pie.re index e37b4fe..b5d97b2 100644 --- a/src/Pie.re +++ b/src/Pie.re @@ -8,14 +8,15 @@ external make: ~activeShape: 'activeShape=?, ~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=?, ~cx: PxOrPrc.t=?, ~cy: PxOrPrc.t=?, @@ -31,14 +32,42 @@ external make: ~legendType: legendType=?, ~minAngle: int=?, ~nameKey: 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=?, - ~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=?, + // Pulled from: + // https://github.com/recharts/recharts/blob/7fb227dae542c3d3093506e6d80a2c2c366f9a26/src/polar/Pie.tsx#L107-L109 + ~onClick: + ( + Js.Nullable.t(Js.t({.. "payload": 'dataItem})), + int, + React.Event.Mouse.t + ) => + unit + =?, + ~onMouseDown: + (Js.t({.. "payload": 'dataItem}), React.Event.Mouse.t) => unit=?, + ~onMouseEnter: + ( + Js.Nullable.t(Js.t({.. "payload": 'dataItem})), + int, + React.Event.Mouse.t + ) => + unit + =?, + ~onMouseLeave: + ( + Js.Nullable.t(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=?, ~outerRadius: PxOrPrc.t=?, ~paddingAngle: int=?, ~startAngle: int=?, diff --git a/src/PieChart.re b/src/PieChart.re index 79039fb..3cd3ca7 100644 --- a/src/PieChart.re +++ b/src/PieChart.re @@ -9,7 +9,8 @@ external make: ~margin: margin=?, ~style: ReactDOM.Style.t=?, ~onClick: (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=?, ~width: int=?, ~children: React.element diff --git a/src/ReferenceArea.re b/src/ReferenceArea.re index e0b2101..79b2823 100644 --- a/src/ReferenceArea.re +++ b/src/ReferenceArea.re @@ -11,7 +11,8 @@ external make: ~fillOpacity: float=?, ~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=?, diff --git a/src/ReferenceDot.re b/src/ReferenceDot.re index cceec20..2c91057 100644 --- a/src/ReferenceDot.re +++ b/src/ReferenceDot.re @@ -10,7 +10,8 @@ external make: ~label: 'label=?, ~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=?, diff --git a/src/ReferenceLine.re b/src/ReferenceLine.re index faa07f1..b7a2242 100644 --- a/src/ReferenceLine.re +++ b/src/ReferenceLine.re @@ -10,7 +10,8 @@ external make: ~label: 'label=?, ~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=?, diff --git a/src/Scatter.re b/src/Scatter.re index acc7d10..0638295 100644 --- a/src/Scatter.re +++ b/src/Scatter.re @@ -22,16 +22,18 @@ external make: ~isAnimationActive: bool=?, ~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 + ] + =?, ~onClick: (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=?, ~onMouseOut: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?, ~onMouseUp: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?, diff --git a/src/ScatterChart.re b/src/ScatterChart.re index 866f231..4755ff2 100644 --- a/src/ScatterChart.re +++ b/src/ScatterChart.re @@ -9,7 +9,8 @@ external make: ~margin: margin=?, ~style: ReactDOM.Style.t=?, ~onClick: (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=?, ~onMouseOut: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?, ~onMouseUp: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?, diff --git a/src/Tooltip.re b/src/Tooltip.re index aa0a7e8..3f2221d 100644 --- a/src/Tooltip.re +++ b/src/Tooltip.re @@ -8,14 +8,15 @@ external make: ~allowEscapeViewBox: Js.t({..})=?, ~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=?, ~content: 'content=?, ~position: Js.t({..})=?, @@ -37,4 +38,5 @@ external make: React.element = "Tooltip"; -let makeProps = (~cursor=?) => makeProps(~cursor=?cursor->TooltipCursor.encodeOpt); +let makeProps = (~cursor=?) => + makeProps(~cursor=?cursor->TooltipCursor.encodeOpt); diff --git a/src/Treemap.re b/src/Treemap.re index b1473b4..9b66211 100644 --- a/src/Treemap.re +++ b/src/Treemap.re @@ -18,7 +18,8 @@ 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=?, ~children: React.element=? diff --git a/src/Utils.re b/src/Utils.re index 506c70b..6765b19 100644 --- a/src/Utils.re +++ b/src/Utils.re @@ -13,7 +13,18 @@ type lineType = [ | `stepAfter ]; -type legendType = [ | `line | `square | `rect | `circle | `cross | `diamond | `square | `star | `triangle | `wye]; +type legendType = [ + | `line + | `square + | `rect + | `circle + | `cross + | `diamond + | `square + | `star + | `triangle + | `wye +]; type scale = [ | `auto @@ -33,11 +44,23 @@ type scale = [ | `threshold ]; -type axisType = [ | `number | `category]; +type axisType = [ + | `number + | `category +]; -type layout = [ | `horizontal | `vertical]; +type layout = [ + | `horizontal + | `vertical +]; -type stackOffset = [ | `expand | `none | `wiggle | `silhouette | `sign]; +type stackOffset = [ + | `expand + | `none + | `wiggle + | `silhouette + | `sign +]; type margin = { . diff --git a/src/XAxis.re b/src/XAxis.re index b23bcd3..1366af5 100644 --- a/src/XAxis.re +++ b/src/XAxis.re @@ -21,16 +21,23 @@ 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=?, ~onMouseOver: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?, ~onMouseUp: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?, - ~orientation: [ | `bottom | `top]=?, + ~orientation: + [ + | `bottom + | `top + ] + =?, ~padding: paddingHorizontal=?, ~reversed: bool=?, ~scale: scale=?, + ~style: ReactDOM.Style.t=?, ~tick: 'tick=?, ~tickCount: int=?, ~tickFormatter: 'tickFormatter=?, @@ -45,4 +52,5 @@ external make: React.element = "XAxis"; -let makeProps = (~interval=?) => makeProps(~interval=?interval->AxisInterval.encodeOpt); +let makeProps = (~interval=?) => + makeProps(~interval=?interval->AxisInterval.encodeOpt); diff --git a/src/YAxis.re b/src/YAxis.re index 71221f0..bb158bf 100644 --- a/src/YAxis.re +++ b/src/YAxis.re @@ -21,16 +21,23 @@ 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=?, ~onMouseOver: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?, ~onMouseUp: (Js.Nullable.t(Js.t({..})), React.Event.Mouse.t) => unit=?, - ~orientation: [ | `left | `right]=?, + ~orientation: + [ + | `left + | `right + ] + =?, ~padding: paddingVertical=?, ~reversed: bool=?, ~scale: scale=?, + ~style: ReactDOM.Style.t=?, ~tick: 'tick=?, ~tickCount: int=?, ~tickFormatter: 'tickFormatter=?, @@ -45,4 +52,5 @@ external make: React.element = "YAxis"; -let makeProps = (~interval=?) => makeProps(~interval=?interval->AxisInterval.encodeOpt); +let makeProps = (~interval=?) => + makeProps(~interval=?interval->AxisInterval.encodeOpt); diff --git a/src/ZAxis.re b/src/ZAxis.re index 78289ff..9c61d5e 100644 --- a/src/ZAxis.re +++ b/src/ZAxis.re @@ -22,13 +22,19 @@ external make: ~range: array(int)=?, ~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=?, - ~orientation: [ | `left | `right]=?, + ~orientation: + [ + | `left + | `right + ] + =?, ~padding: paddingVertical=?, ~reversed: bool=?, ~scale: scale=?, @@ -46,4 +52,5 @@ external make: React.element = "ZAxis"; -let makeProps = (~interval=?) => makeProps(~interval=?interval->AxisInterval.encodeOpt); +let makeProps = (~interval=?) => + makeProps(~interval=?interval->AxisInterval.encodeOpt);