Home / Function/ zoomToBatch() — react Function Reference

zoomToBatch() — react Function Reference

Architecture documentation for the zoomToBatch() function in CanvasPageContextMenu.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  804cd5a5_47ad_6091_4607_cf33ec051361["zoomToBatch()"]
  e0a3b260_ea80_6b59_5c7d_18081c4333a6["CanvasPageContextMenu.js"]
  804cd5a5_47ad_6091_4607_cf33ec051361 -->|defined in| e0a3b260_ea80_6b59_5c7d_18081c4333a6
  1962c520_14de_6efa_4ec0_669c5452228e["CanvasPageContextMenu()"]
  1962c520_14de_6efa_4ec0_669c5452228e -->|calls| 804cd5a5_47ad_6091_4607_cf33ec051361
  73b69eb1_1def_ae18_854c_a93b29fe5e7d["moveStateToRange()"]
  804cd5a5_47ad_6091_4607_cf33ec051361 -->|calls| 73b69eb1_1def_ae18_854c_a93b29fe5e7d
  style 804cd5a5_47ad_6091_4607_cf33ec051361 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-timeline/src/CanvasPageContextMenu.js lines 33–55

function zoomToBatch(
  data: TimelineData,
  measure: ReactMeasure,
  viewState: ViewState,
  width: number,
) {
  const {batchUID} = measure;
  const [rangeStart, rangeEnd] = getBatchRange(batchUID, data);

  // Convert from time range to ScrollState
  const scrollState = moveStateToRange({
    state: viewState.horizontalScrollState,
    rangeStart,
    rangeEnd,
    contentLength: data.duration,

    minContentLength: data.duration * MIN_ZOOM_LEVEL,
    maxContentLength: data.duration * MAX_ZOOM_LEVEL,
    containerLength: width,
  });

  viewState.updateHorizontalScrollState(scrollState);
}

Domain

Subdomains

Frequently Asked Questions

What does zoomToBatch() do?
zoomToBatch() is a function in the react codebase, defined in packages/react-devtools-timeline/src/CanvasPageContextMenu.js.
Where is zoomToBatch() defined?
zoomToBatch() is defined in packages/react-devtools-timeline/src/CanvasPageContextMenu.js at line 33.
What does zoomToBatch() call?
zoomToBatch() calls 1 function(s): moveStateToRange.
What calls zoomToBatch()?
zoomToBatch() is called by 1 function(s): CanvasPageContextMenu.

Analyze Your Own Codebase

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

Try Supermodel Free