@parca/utilities
Advanced tools
Comparing version 0.0.84 to 0.0.85
@@ -6,2 +6,6 @@ # Change Log | ||
## [0.0.85](https://github.com/parca-dev/parca/compare/@parca/utilities@0.0.84...@parca/utilities@0.0.85) (2024-07-29) | ||
**Note:** Version bump only for package @parca/utilities | ||
## 0.0.84 (2024-07-29) | ||
@@ -8,0 +12,0 @@ |
@@ -38,3 +38,2 @@ import { Label } from '@parca/client'; | ||
export declare const diffColor: (diff: bigint, cumulative: bigint, isDarkMode: boolean) => string; | ||
export declare const diffColorPerSecond: (diff: number, cumulative: number, isDarkMode: boolean) => string; | ||
export declare const isSearchMatch: (currentSearchString: string | undefined, name: string) => boolean; | ||
@@ -41,0 +40,0 @@ export declare const saveAsBlob: (blob: Blob, filename: string) => void; |
@@ -242,8 +242,2 @@ // Copyright 2022 The Parca Authors | ||
}; | ||
export const diffColorPerSecond = (diff, cumulative, isDarkMode) => { | ||
const prevValue = cumulative - diff; | ||
const diffRatio = prevValue > 0 ? (diff !== 0 ? diff / prevValue : 0) : 1.0; | ||
const hasDiff = Math.abs(diffRatio) > DIFF_RATIO_THRESHOLD; | ||
return diffColorRatio(hasDiff, diffRatio, isDarkMode); | ||
}; | ||
const diffColorRatio = (hasDiff, diffRatio, isDarkMode) => { | ||
@@ -250,0 +244,0 @@ const diffTransparency = hasDiff ? Math.min((Math.abs(diffRatio) / 2 + 0.5) * 0.8, 0.8) : 0; |
{ | ||
"name": "@parca/utilities", | ||
"version": "0.0.84", | ||
"version": "0.0.85", | ||
"description": "A set of reusable functions for Parca", | ||
@@ -28,3 +28,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "42342c1a093040c94a83beb1161beedcaa2f8580" | ||
"gitHead": "cdd20a679a256fa717088741fb9065eaec99c2d3" | ||
} |
@@ -329,14 +329,2 @@ // Copyright 2022 The Parca Authors | ||
export const diffColorPerSecond = ( | ||
diff: number, | ||
cumulative: number, | ||
isDarkMode: boolean | ||
): string => { | ||
const prevValue = cumulative - diff; | ||
const diffRatio = prevValue > 0 ? (diff !== 0 ? diff / prevValue : 0) : 1.0; | ||
const hasDiff = Math.abs(diffRatio) > DIFF_RATIO_THRESHOLD; | ||
return diffColorRatio(hasDiff, diffRatio, isDarkMode); | ||
}; | ||
const diffColorRatio = (hasDiff: boolean, diffRatio: number, isDarkMode: boolean): string => { | ||
@@ -343,0 +331,0 @@ const diffTransparency = hasDiff ? Math.min((Math.abs(diffRatio) / 2 + 0.5) * 0.8, 0.8) : 0; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90778
1620