@cori-risi/cori.data.api / HoverInfo

HoverInfo()

HoverInfo(props): Element

This is a prototype generalization of the HoverInfo component used in the Who Wins B2S app

import { HoverInfo } from '@cori-risi/cori.data.api';

import "@cori-risi/cori.data.api/inst/dist/cori.data.api.css";

// ...

const [ hoverInfo, setHoverInfo ] = useState<HoverObject | null>(null);

// ...

<HoverInfo hoverInfo={hoverInfo}>
    <div style={{pointerEvents: "none"}}>
        <h3>{ hoverInfo.name }</h3>
        <p>...</p>
    </div>
</HoverInfo>

Parameters

props

props.children?: ReactElement<any, any> | ReactElement<any, any>[]

props.hoverInfo: HoverObject

an object that should, at minimum, contain x and y values (screen coordinates in pixels); “name” is also a userful prop

props.xOffset?: number

the HoverInfo box will be rendered at this offset from the event’s x coordinate

props.yOffset?: number

the HoverInfo box will be rendered at this offset from the event’s y coordinate

props.zIndex?: number

Returns

Element

Defined in

@cori-risi/components/HoverInfo.tsx:42