Closed lpatiny closed 2 years ago
Using react hooks conditionally is forbidden i couldn't find a solution to implement these functionalities, i only suggest adding a new param in react-plot hooks so the user will be able to use them conditionally or would you please suggest any other possible solutions?
I think that the hooks can always be 'active'. However we could think about properties at the level of the hook that disabled it.
For example:
Could have direction:'none'
to disable the hook.
Same for the wheel and crosshair hooks.
@targos Does this make sense ?
Yes, but I would create a general option.
What about usePlotEvents({ disabled: true })
which would not pass the callbacks and can be inherited by all higher-level hooks?
which would not pass the callbacks and can be inherited by all higher-level hooks?
I agree with using a general option
Please also add small default spaces between the axis values and axis labels (4px ?)
As well as between the title and the chart
Please check also that you deal correctly with the fact that the data may be missing a scale label of the chart title.
Add properties allowing to zoom, scroll, pan
zoom
: 'horizontal' (useAxisZoom), 'vertical' (useAxisZoom), 'rectangular' (useRectangularZoom), default: 'horizontal', could be empty for no zoomwheelZoom
: 'vertical', useAxisWheelZoom, default 'vertical'crossHair
: true / false, should we display crosshair (useCrossHair), default: trueSome default behaviour without properties:
Some other properties:
showHorizontalAxis
(default: true)showVerticalAxis
(default: true)showHorizontalGrid
(default: true)showVerticalGrid
(default: true)flipHorizontalAxis
(default: false)