(position: number[], width: number, height: number, api: ExtensionAPI)
| 136 | |
| 137 | // Do not overflow ec container |
| 138 | function confineInContainer(position: number[], width: number, height: number, api: ExtensionAPI) { |
| 139 | const viewWidth = api.getWidth(); |
| 140 | const viewHeight = api.getHeight(); |
| 141 | position[0] = Math.min(position[0] + width, viewWidth) - width; |
| 142 | position[1] = Math.min(position[1] + height, viewHeight) - height; |
| 143 | position[0] = Math.max(position[0], 0); |
| 144 | position[1] = Math.max(position[1], 0); |
| 145 | } |
| 146 | |
| 147 | export function getValueLabel( |
| 148 | value: ScaleDataValue, |
no test coverage detected
searching dependent graphs…