Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3d790f6
Implement View class and render flamechart
taneliang Jul 23, 2020
1569e39
Implement React events row
taneliang Jul 23, 2020
886729e
Implement TimeAxisMarkersView
taneliang Jul 23, 2020
bbb6a26
Implement React measures view
taneliang Jul 23, 2020
2518fd9
Split canvas views into individual files
taneliang Jul 23, 2020
a6a1902
Undo auto-import of Facebook profile
taneliang Jul 23, 2020
aca722f
Clean up geometry.js
taneliang Jul 27, 2020
226f98e
Implement horizontal pan clamp
taneliang Jul 27, 2020
d0a6b94
Implement React events hover
taneliang Jul 27, 2020
4699752
Replace drawRect -> visibleArea and draw
taneliang Jul 27, 2020
46b28d0
Overhaul event handling: single responders -> all views handle all ev…
taneliang Jul 27, 2020
f88fb39
Implement React measures hover
taneliang Jul 27, 2020
df6e404
Implement flamechart hover
taneliang Jul 27, 2020
3db6d62
Implement VerticalScrollView and flamechart scroll
taneliang Jul 27, 2020
d2922f4
Implement zoom and mouse wheel scroll
taneliang Jul 27, 2020
ad97329
Implement horizontal view clamp on canvas resize
taneliang Jul 27, 2020
fb2fa2d
Delete most dead code
taneliang Jul 27, 2020
004ef38
Remove schedulerCanvasHeight (resolves #39)
taneliang Jul 27, 2020
f98da5f
Remove irrelevant TODOs and remove more dead code
taneliang Jul 27, 2020
8ca26b1
Merge branch 'master' into eliang/uiview
taneliang Jul 27, 2020
32f5164
Fix lint
taneliang Jul 27, 2020
e8b909a
Implement setSubviewNeedsDisplay
taneliang Jul 27, 2020
6843c7d
Fix offset X clamping on zoom
taneliang Jul 27, 2020
ad1f430
Rename subviewNeedsDisplay -> subviewsNeedDisplay
taneliang Jul 27, 2020
822f3fb
Fix offsetX jumps on zoom
taneliang Jul 28, 2020
2077d93
Add content-based zoom clamp (resolves #83)
taneliang Jul 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// @flow

import type {FlamechartData, ReactLane, ReactProfilerData} from './types';
import type {FlamechartData, ReactProfilerData} from './types';

import React, {useState, useCallback} from 'react';
import {unstable_batchedUpdates} from 'react-dom';

import {getLaneHeight} from './canvas/canvasUtils';
import {REACT_TOTAL_NUM_LANES} from './constants';
import ImportPage from './ImportPage';
import CanvasPage from './CanvasPage';

Expand All @@ -15,7 +13,6 @@ export default function App() {
null,
);
const [flamechart, setFlamechart] = useState<FlamechartData | null>(null);
const [schedulerCanvasHeight, setSchedulerCanvasHeight] = useState<number>(0);

const handleDataImported = useCallback(
(
Expand All @@ -25,27 +22,11 @@ export default function App() {
unstable_batchedUpdates(() => {
setProfilerData(importedProfilerData);
setFlamechart(importedFlamechart);

const lanesToRender: ReactLane[] = Array.from(
Array(REACT_TOTAL_NUM_LANES).keys(),
);
// TODO: Figure out if this is necessary
setSchedulerCanvasHeight(
lanesToRender.reduce((height, lane) => {
return height + getLaneHeight(importedProfilerData, lane);
}, 0),
);
});
},
);
if (profilerData && flamechart) {
return (
<CanvasPage
profilerData={profilerData}
flamechart={flamechart}
schedulerCanvasHeight={schedulerCanvasHeight}
/>
);
return <CanvasPage profilerData={profilerData} flamechart={flamechart} />;
} else {
return <ImportPage onDataImported={handleDataImported} />;
}
Expand Down
Loading