(props)
| 10948 | const { Table } = _vegaDeckGl.controls; |
| 10949 | class Tooltip { |
| 10950 | constructor(props){ |
| 10951 | const renderProps = { |
| 10952 | cssPrefix: props.cssPrefix, |
| 10953 | rows: getRows(props.item, props.options) |
| 10954 | }; |
| 10955 | this.element = renderTooltip(renderProps); |
| 10956 | if (this.element) { |
| 10957 | this.element.style.position = "absolute"; |
| 10958 | this.child = this.element.firstChild; |
| 10959 | document.body.appendChild(this.element); |
| 10960 | //measure and move as necessary |
| 10961 | let m = outerSize(this.child); |
| 10962 | while(m.height > document.documentElement.clientHeight){ |
| 10963 | let tr = this.child.querySelector("tr:last-child"); |
| 10964 | if (tr) tr.parentElement.removeChild(tr); |
| 10965 | else break; |
| 10966 | m = outerSize(this.child); |
| 10967 | } |
| 10968 | if (props.position.clientX + m.width >= document.documentElement.clientWidth) this.child.style.right = "0"; |
| 10969 | let moveTop = true; |
| 10970 | if (props.position.clientY + m.height >= document.documentElement.clientHeight) { |
| 10971 | if (props.position.clientY - m.height > 0) this.child.style.bottom = "0"; |
| 10972 | else moveTop = false; |
| 10973 | } |
| 10974 | if (moveTop) this.element.style.top = `${props.position.clientY}px`; |
| 10975 | this.element.style.left = `${props.position.clientX}px`; |
| 10976 | } |
| 10977 | } |
| 10978 | finalize() { |
| 10979 | if (this.element) document.body.removeChild(this.element); |
| 10980 | this.element = null; |
nothing calls this directly
no test coverage detected