SchedulingEventsView Class — react Architecture
Architecture documentation for the SchedulingEventsView class in SchedulingEventsView.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD b603a917_4a82_e943_1f8b_6d182bba008b["SchedulingEventsView"] 25e4583e_f456_f560_39a0_cd2c2a2ed857["SchedulingEventsView.js"] b603a917_4a82_e943_1f8b_6d182bba008b -->|defined in| 25e4583e_f456_f560_39a0_cd2c2a2ed857 930efe0a_9650_bcc6_c2e7_c4cd4f8278e7["constructor()"] b603a917_4a82_e943_1f8b_6d182bba008b -->|method| 930efe0a_9650_bcc6_c2e7_c4cd4f8278e7 e626536d_91a0_5f1d_a760_8e34d3ca9056["desiredSize()"] b603a917_4a82_e943_1f8b_6d182bba008b -->|method| e626536d_91a0_5f1d_a760_8e34d3ca9056 387acecb_b89f_0767_e90e_48df2ad5499e["setHoveredEvent()"] b603a917_4a82_e943_1f8b_6d182bba008b -->|method| 387acecb_b89f_0767_e90e_48df2ad5499e e90b4f85_79ff_f7c6_2a8c_0b24621f67c7["_drawSingleSchedulingEvent()"] b603a917_4a82_e943_1f8b_6d182bba008b -->|method| e90b4f85_79ff_f7c6_2a8c_0b24621f67c7 bdfbce96_aa1e_92d9_4ef5_88d5170201a6["draw()"] b603a917_4a82_e943_1f8b_6d182bba008b -->|method| bdfbce96_aa1e_92d9_4ef5_88d5170201a6 c595d935_d7b4_ffea_37fb_def998a35c5d["_handleMouseMove()"] b603a917_4a82_e943_1f8b_6d182bba008b -->|method| c595d935_d7b4_ffea_37fb_def998a35c5d 8dcdebb7_90c8_2bb2_ec59_946597f384cb["_handleClick()"] b603a917_4a82_e943_1f8b_6d182bba008b -->|method| 8dcdebb7_90c8_2bb2_ec59_946597f384cb f1973f0e_f579_1212_e145_55004bca6693["handleInteraction()"] b603a917_4a82_e943_1f8b_6d182bba008b -->|method| f1973f0e_f579_1212_e145_55004bca6693
Relationship Graph
Source Code
packages/react-devtools-timeline/src/content-views/SchedulingEventsView.js lines 43–288
export class SchedulingEventsView extends View {
_profilerData: TimelineData;
_intrinsicSize: Size;
_hoveredEvent: SchedulingEvent | null = null;
onHover: ((event: SchedulingEvent | null) => void) | null = null;
onClick:
| ((event: SchedulingEvent | null, eventIndex: number | null) => void)
| null = null;
constructor(surface: Surface, frame: Rect, profilerData: TimelineData) {
super(surface, frame);
this._profilerData = profilerData;
this._intrinsicSize = {
width: this._profilerData.duration,
height: EVENT_ROW_HEIGHT_FIXED,
};
}
desiredSize(): Size {
return this._intrinsicSize;
}
setHoveredEvent(hoveredEvent: SchedulingEvent | null) {
if (this._hoveredEvent === hoveredEvent) {
return;
}
this._hoveredEvent = hoveredEvent;
this.setNeedsDisplay();
}
/**
* Draw a single `SchedulingEvent` as a circle in the canvas.
*/
_drawSingleSchedulingEvent(
context: CanvasRenderingContext2D,
rect: Rect,
event: SchedulingEvent,
baseY: number,
scaleFactor: number,
showHoverHighlight: boolean,
) {
const {frame} = this;
const {timestamp, type, warning} = event;
const x = timestampToPosition(timestamp, scaleFactor, frame);
const radius = REACT_EVENT_DIAMETER / 2;
const eventRect: Rect = {
origin: {
x: x - radius,
y: baseY,
},
size: {width: REACT_EVENT_DIAMETER, height: REACT_EVENT_DIAMETER},
};
if (!rectIntersectsRect(eventRect, rect)) {
return; // Not in view
}
let fillStyle = null;
if (warning !== null) {
fillStyle = showHoverHighlight
? COLORS.WARNING_BACKGROUND_HOVER
: COLORS.WARNING_BACKGROUND;
} else {
switch (type) {
case 'schedule-render':
case 'schedule-state-update':
case 'schedule-force-update':
fillStyle = showHoverHighlight
? COLORS.REACT_SCHEDULE_HOVER
: COLORS.REACT_SCHEDULE;
break;
default:
if (__DEV__) {
console.warn('Unexpected event type "%s"', type);
}
break;
}
}
Domain
Source
Frequently Asked Questions
What is the SchedulingEventsView class?
SchedulingEventsView is a class in the react codebase, defined in packages/react-devtools-timeline/src/content-views/SchedulingEventsView.js.
Where is SchedulingEventsView defined?
SchedulingEventsView is defined in packages/react-devtools-timeline/src/content-views/SchedulingEventsView.js at line 43.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free