Home / Function/ boxToRect() — react Function Reference

boxToRect() — react Function Reference

Architecture documentation for the boxToRect() function in geometry.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ee75b67e_5a11_9c92_ca64_32a3289b3e68["boxToRect()"]
  1d481b0c_03e1_6f28_eff1_74d4566b3dc8["geometry.js"]
  ee75b67e_5a11_9c92_ca64_32a3289b3e68 -->|defined in| 1d481b0c_03e1_6f28_eff1_74d4566b3dc8
  9ca9174f_303e_0f6b_0371_0eaf35e67cb8["intersectionOfRects()"]
  9ca9174f_303e_0f6b_0371_0eaf35e67cb8 -->|calls| ee75b67e_5a11_9c92_ca64_32a3289b3e68
  4f0df6ba_57ab_cc88_9a94_1bc63bfad061["unionOfRects()"]
  4f0df6ba_57ab_cc88_9a94_1bc63bfad061 -->|calls| ee75b67e_5a11_9c92_ca64_32a3289b3e68
  style ee75b67e_5a11_9c92_ca64_32a3289b3e68 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-timeline/src/view-base/geometry.js lines 68–80

function boxToRect(box: Box): Rect {
  const [top, right, bottom, left] = box;
  return {
    origin: {
      x: left,
      y: top,
    },
    size: {
      width: right - left,
      height: bottom - top,
    },
  };
}

Domain

Subdomains

Frequently Asked Questions

What does boxToRect() do?
boxToRect() is a function in the react codebase, defined in packages/react-devtools-timeline/src/view-base/geometry.js.
Where is boxToRect() defined?
boxToRect() is defined in packages/react-devtools-timeline/src/view-base/geometry.js at line 68.
What calls boxToRect()?
boxToRect() is called by 2 function(s): intersectionOfRects, unionOfRects.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free