(styles: CSSStyleDeclaration, style: string, suffix?: string)
| 51 | |
| 52 | const positions = ['top', 'right', 'bottom', 'left']; |
| 53 | function getPositionedStyle(styles: CSSStyleDeclaration, style: string, suffix?: string): ChartArea { |
| 54 | const result = {} as ChartArea; |
| 55 | suffix = suffix ? '-' + suffix : ''; |
| 56 | for (let i = 0; i < 4; i++) { |
| 57 | const pos = positions[i]; |
| 58 | result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0; |
| 59 | } |
| 60 | result.width = result.left + result.right; |
| 61 | result.height = result.top + result.bottom; |
| 62 | return result; |
| 63 | } |
| 64 | |
| 65 | const useOffsetPos = (x: number, y: number, target: HTMLElement | EventTarget) => |
| 66 | (x > 0 || y > 0) && (!target || !(target as HTMLElement).shadowRoot); |
no outgoing calls
no test coverage detected
searching dependent graphs…