@parca/profile 0.16.323 → 0.16.324

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.16.324](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.323...@parca/profile@0.16.324) (2023-12-04)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.16.323](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.322...@parca/profile@0.16.323) (2023-12-02)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -14,12 +14,16 @@ import { divide, valueFormatter } from '@parca/utilities';
14
14
  import { FIELD_CUMULATIVE, FIELD_DIFF, FIELD_LOCATION_ADDRESS, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
15
15
  import { getTextForCumulative, nodeLabel } from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
16
16
  export const useGraphTooltip = ({ table, unit, total, totalUnfiltered, row, level, }) => {
17
- if (row === null || row === 0) {
17
+ if (row === null) {
18
18
  return null;
19
19
  }
20
20
  const locationAddress = table.getChild(FIELD_LOCATION_ADDRESS)?.get(row) ?? 0n;
21
- const cumulative = BigInt(table.getChild(FIELD_CUMULATIVE)?.get(row)) ?? 0n;
22
- const diff = BigInt(table.getChild(FIELD_DIFF)?.get(row)) ?? 0n;
21
+ const cumulative = table.getChild(FIELD_CUMULATIVE)?.get(row) !== null
22
+ ? BigInt(table.getChild(FIELD_CUMULATIVE)?.get(row))
23
+ : 0n;
24
+ const diff = table.getChild(FIELD_DIFF)?.get(row) !== null
25
+ ? BigInt(table.getChild(FIELD_DIFF)?.get(row))
26
+ : 0n;
23
27
  const prevValue = cumulative - diff;
24
28
  const diffRatio = diff !== 0n ? divide(diff, prevValue) : 0;
25
29
  const diffSign = diff > 0 ? '+' : '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.323",
3
+ "version": "0.16.324",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.100",
@@ -50,5 +50,5 @@
50
50
  "access": "public",
51
51
  "registry": "https://registry.npmjs.org/"
52
52
  },
53
- "gitHead": "c5ce6f1d679f56d3bb43dc411b106c420d3f052d"
53
+ "gitHead": "cc769942deb4586348a6001bfd8bb8a926efa1c0"
54
54
  }
@@ -48,13 +48,20 @@ export const useGraphTooltip = ({
48
48
  row,
49
49
  level,
50
50
  }: Props): GraphTooltipData | null => {
51
- if (row === null || row === 0) {
51
+ if (row === null) {
52
52
  return null;
53
53
  }
54
54
 
55
55
  const locationAddress: bigint = table.getChild(FIELD_LOCATION_ADDRESS)?.get(row) ?? 0n;
56
- const cumulative: bigint = BigInt(table.getChild(FIELD_CUMULATIVE)?.get(row)) ?? 0n;
57
- const diff: bigint = BigInt(table.getChild(FIELD_DIFF)?.get(row)) ?? 0n;
56
+
57
+ const cumulative: bigint =
58
+ table.getChild(FIELD_CUMULATIVE)?.get(row) !== null
59
+ ? BigInt(table.getChild(FIELD_CUMULATIVE)?.get(row))
60
+ : 0n;
61
+ const diff: bigint =
62
+ table.getChild(FIELD_DIFF)?.get(row) !== null
63
+ ? BigInt(table.getChild(FIELD_DIFF)?.get(row))
64
+ : 0n;
58
65
 
59
66
  const prevValue = cumulative - diff;
60
67
  const diffRatio = diff !== 0n ? divide(diff, prevValue) : 0;