How to use the dash-table/components/tooltipHelper function in dash-table

To help you get started, we’ve selected a few dash-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plotly / dash-table / src / dash-table / components / ControlledTable / fragments / TableTooltip.tsx View on Github external
private adjustPosition() {
        const { cell } = this.state;

        const el = ReactDOM.findDOMNode(this.refs.tooltip) as any;

        const { positionalParent, parent } = tooltipHelper(el, cell);

        if (!positionalParent || !parent || !el) {
            return;
        }

        const positionalBounds = positionalParent.getBoundingClientRect();
        const parentBounds = parent.getBoundingClientRect();

        const { clientWidth: elWidth, clientHeight: elHeight } = el;
        const elAnchorHeight = Math.max(
            parseFloat(getComputedStyle(el, ':before').borderWidth || '0'),
            parseFloat(getComputedStyle(el, ':after').borderWidth || '0')
        );

        const leftCorrection = (parentBounds.width - elWidth) / 2;
        let left = (parentBounds.left - positionalBounds.left) + positionalParent.scrollLeft + leftCorrection;