Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderWrapper = true,
children,
animate,
motionStiffness,
motionDamping,
}) => {
const container = useRef(null)
const {
showTooltipAt,
showTooltipFromEvent,
hideTooltip,
isTooltipVisible,
tooltipContent,
tooltipPosition,
tooltipAnchor,
} = useTooltipHandlers(container)
return (
{/* we should not render the div element if using the HTTP API */}
{renderWrapper === true && (
<div style="{containerStyle}">
{children}
{isTooltipVisible && (</div>
).isRequired,
legends: PropTypes.arrayOf(PropTypes.shape(LegendPropShape)).isRequired,
isInteractive: PropTypes.bool.isRequired,
debugMesh: PropTypes.bool.isRequired,
tooltip: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,
tooltipFormat: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
enableSlices: PropTypes.oneOf(['x', 'y', false]).isRequired,
debugSlices: PropTypes.bool.isRequired,
sliceTooltip: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,
enableCrosshair: PropTypes.bool.isRequired,
crosshairType: crosshairPropTypes.type.isRequired,
}
export const LinePropTypes = {
...commonPropTypes,
enablePointLabel: PropTypes.bool.isRequired,
useMesh: PropTypes.bool.isRequired,
...motionPropTypes,
}
export const LineCanvasPropTypes = {
pixelRatio: PropTypes.number.isRequired,
...commonPropTypes,
}
const commonDefaultProps = {
curve: 'linear',