(
x: number, y: number,
content: TooltipHTMLContent | TooltipRichContent,
viewWidth: number,
viewHeight: number
)
| 1148 | } |
| 1149 | |
| 1150 | function confineTooltipPosition( |
| 1151 | x: number, y: number, |
| 1152 | content: TooltipHTMLContent | TooltipRichContent, |
| 1153 | viewWidth: number, |
| 1154 | viewHeight: number |
| 1155 | ): [number, number] { |
| 1156 | const size = content.getSize(); |
| 1157 | const width = size[0]; |
| 1158 | const height = size[1]; |
| 1159 | |
| 1160 | x = Math.min(x + width, viewWidth) - width; |
| 1161 | y = Math.min(y + height, viewHeight) - height; |
| 1162 | x = Math.max(x, 0); |
| 1163 | y = Math.max(y, 0); |
| 1164 | |
| 1165 | return [x, y]; |
| 1166 | } |
| 1167 | |
| 1168 | function calcTooltipPosition( |
| 1169 | position: TooltipOption['position'], |
no test coverage detected
searching dependent graphs…