Skip to content

Commit aac4515

Browse files
author
Brian Vaughn
committed
Change Profiler snapshot selector scale to log
1 parent 7df6572 commit aac4515

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/react-devtools-shared/src/devtools/views/Profiler/SnapshotCommitListItem.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ function SnapshotCommitListItem({data: itemData, index, style}: Props) {
4141

4242
// Guard against commits with duration 0
4343
const percentage =
44-
Math.min(1, Math.max(0, commitDuration / maxDuration)) || 0;
44+
Math.min(
45+
1,
46+
Math.max(0, Math.log(commitDuration) / Math.log(maxDuration)),
47+
) || 0;
4548
const isSelected = selectedCommitIndex === index;
4649

4750
// Leave a 1px gap between snapshots
@@ -77,7 +80,7 @@ function SnapshotCommitListItem({data: itemData, index, style}: Props) {
7780
style={{
7881
height: `${Math.round(percentage * 100)}%`,
7982
backgroundColor:
80-
percentage > 0 ? getGradientColor(percentage) : undefined,
83+
commitDuration > 0 ? getGradientColor(percentage) : undefined,
8184
}}
8285
/>
8386
</div>

0 commit comments

Comments
 (0)