Home / Function/ getCanvasContext() — react Function Reference

getCanvasContext() — react Function Reference

Architecture documentation for the getCanvasContext() function in Surface.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  fdb03c79_f3eb_2541_2f0e_64f1d4c6e09e["getCanvasContext()"]
  2fbafaf8_32f6_4129_38fc_89470d906d24["Surface.js"]
  fdb03c79_f3eb_2541_2f0e_64f1d4c6e09e -->|defined in| 2fbafaf8_32f6_4129_38fc_89470d906d24
  ac91b97c_8a12_d69a_68bd_899304b8065f["setCanvas()"]
  ac91b97c_8a12_d69a_68bd_899304b8065f -->|calls| fdb03c79_f3eb_2541_2f0e_64f1d4c6e09e
  62173a73_e35e_ddd0_2860_c8904e175c4f["configureRetinaCanvas()"]
  fdb03c79_f3eb_2541_2f0e_64f1d4c6e09e -->|calls| 62173a73_e35e_ddd0_2860_c8904e175c4f
  style fdb03c79_f3eb_2541_2f0e_64f1d4c6e09e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-timeline/src/view-base/Surface.js lines 37–51

  (
    canvas: HTMLCanvasElement,
    height: number,
    width: number,
    scaleCanvas: boolean = true,
  ): CanvasRenderingContext2D => {
    const context = canvas.getContext('2d', {alpha: false});
    if (scaleCanvas) {
      configureRetinaCanvas(canvas, height, width);

      // Scale all drawing operations by the dpr, so you don't have to worry about the difference.
      context.scale(DPR, DPR);
    }
    return context;
  },

Domain

Subdomains

Called By

Frequently Asked Questions

What does getCanvasContext() do?
getCanvasContext() is a function in the react codebase, defined in packages/react-devtools-timeline/src/view-base/Surface.js.
Where is getCanvasContext() defined?
getCanvasContext() is defined in packages/react-devtools-timeline/src/view-base/Surface.js at line 37.
What does getCanvasContext() call?
getCanvasContext() calls 1 function(s): configureRetinaCanvas.
What calls getCanvasContext()?
getCanvasContext() is called by 1 function(s): setCanvas.

Analyze Your Own Codebase

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

Try Supermodel Free