MCPcopy Index your code
hub / github.com/simstudioai/sim / getTooltipTranslate

Function getTooltipTranslate

packages/emcn/src/components/tooltip/tooltip.tsx:277–284  ·  view source on GitHub ↗
(state: FloatingTooltipState)

Source from the content-addressed store, hash-verified

275}
276
277function getTooltipTranslate(state: FloatingTooltipState): string {
278 const xOffset =
279 state.alignX === 'left' ? `${TOOLTIP_OFFSET}px` : `calc(-100% - ${TOOLTIP_OFFSET}px)`
280 const yOffset =
281 state.alignY === 'below' ? `${TOOLTIP_OFFSET}px` : `calc(-100% - ${TOOLTIP_OFFSET}px)`
282
283 return `translate3d(${state.x}px, ${state.y}px, 0) translate(${xOffset}, ${yOffset})`
284}
285
286/**
287 * Kept for API compatibility with the previous tooltip. The floating tooltip has no shared hover

Callers 1

tooltip.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected