MCPcopy
hub / github.com/palantir/plottable / entityBounds

Function entityBounds

src/utils/domUtils.ts:41–50  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

39}
40
41export function entityBounds(element: Element): IEntityBounds {
42 if (element instanceof SVGElement) {
43 return elementBBox(d3.select(element));
44 } else if (element instanceof HTMLElement) {
45 const rect = element.getBoundingClientRect();
46 return { x: rect.left, y: rect.top, width: rect.width, height: rect.height };
47 } else {
48 return { x: 0, y: 0, width: 0, height: 0 };
49 }
50}
51
52/**
53 * Screen refresh rate which is assumed to be 60fps

Callers 2

legendTests.tsFile · 0.90
expectedEntityForIndexFunction · 0.90

Calls 1

elementBBoxFunction · 0.85

Tested by

no test coverage detected