bounding box
The smallest rectangle that encloses a shape or element, given by its position and size or by two opposite corners.
In more detail
Its edges are the smallest and largest x and y values the shape reaches. In a web page, element.getBoundingClientRect() returns an element's box as top, left, width and height relative to the viewport, and positioning code uses it to place floating elements such as tooltips. Graphics libraries often define ovals and other shapes by their bounding box.
Related terms
- Floating UI — A JavaScript library, and the general technique, for positioning a floating element such as a tooltip next to a reference element.
- collision detection — Checking whether a floating element would run off the edge of the viewport and moving it if so.
- graphics object — A shape in graphics.py, such as a Point, Line, Circle, Rectangle, Oval, Polygon or Text, which you construct and then draw in a window.
- coordinates — A pair of numbers, x across and y down or up, that gives a position in a window.
Taught in
- Overlay Architecture: Portals, Stacking Contexts & Backdrops — Design Systems & Component Engineering
- Floating Primitives: Popovers, Tooltips & Positioning — Design Systems & Component Engineering
- Sample Graphics Programs — Hands-on Python: Complete Video Course & Book