GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Swap log with cbrt for commit bar height (#20952) · koto/react@75d53ac

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-devtools-shared/src/devtools/views/Profiler
    • SnapshotCommitListItem.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/devtools/views/Profiler/SnapshotCommitListItem.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ function SnapshotCommitListItem({data: itemData, index, style}: Props) {
4040
const commitDuration = commitDurations[index];
4141
const commitTime = commitTimes[index];
4242

43-
// Use natural log for bar height.
43+
// Use natural cbrt for bar height.
4444
// This prevents one (or a few) outliers from squishing the majority of other commits.
4545
// So rather than e.g. _█_ we get something more like e.g. ▄█_
4646
const heightScale =
4747
Math.min(
4848
1,
49-
Math.max(0, Math.log(commitDuration) / Math.log(maxDuration)),
49+
Math.max(0, Math.cbrt(commitDuration) / Math.cbrt(maxDuration)),
5050
) || 0;
5151

5252
// Use a linear scale for color.
5353
// This gives some visual contrast between cheaper and more expensive commits
54-
// and somewhat compensates for the log scale height.
54+
// and somewhat compensates for the cbrt scale height.
5555
const colorScale =
5656
Math.min(1, Math.max(0, commitDuration / maxDuration)) || 0;
5757

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.