@parca/profile 0.16.416 → 0.16.418

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.
Files changed (98) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/Callgraph/index.js +3 -2
  3. package/dist/GraphTooltipArrow/Content.d.ts +2 -3
  4. package/dist/GraphTooltipArrow/Content.d.ts.map +1 -1
  5. package/dist/GraphTooltipArrow/Content.js +6 -5
  6. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.d.ts +2 -1
  7. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.d.ts.map +1 -1
  8. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +6 -7
  9. package/dist/GraphTooltipArrow/useGraphTooltip/index.d.ts +2 -3
  10. package/dist/GraphTooltipArrow/useGraphTooltip/index.d.ts.map +1 -1
  11. package/dist/GraphTooltipArrow/useGraphTooltip/index.js +9 -30
  12. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts +1 -3
  13. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
  14. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +6 -16
  15. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  16. package/dist/ProfileExplorer/ProfileExplorerCompare.js +3 -3
  17. package/dist/ProfileExplorer/ProfileExplorerSingle.d.ts.map +1 -1
  18. package/dist/ProfileExplorer/ProfileExplorerSingle.js +1 -1
  19. package/dist/ProfileExplorer/index.d.ts.map +1 -1
  20. package/dist/ProfileExplorer/index.js +1 -7
  21. package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.d.ts +1 -3
  22. package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.d.ts.map +1 -1
  23. package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.js +2 -2
  24. package/dist/ProfileIcicleGraph/IcicleGraph/index.d.ts +0 -2
  25. package/dist/ProfileIcicleGraph/IcicleGraph/index.d.ts.map +1 -1
  26. package/dist/ProfileIcicleGraph/IcicleGraph/index.js +4 -3
  27. package/dist/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.d.ts +1 -3
  28. package/dist/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.d.ts.map +1 -1
  29. package/dist/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.js +8 -20
  30. package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.d.ts +2 -3
  31. package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.d.ts.map +1 -1
  32. package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.js +3 -2
  33. package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.d.ts.map +1 -1
  34. package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.js +6 -46
  35. package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts +2 -5
  36. package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts.map +1 -1
  37. package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.js +6 -12
  38. package/dist/ProfileIcicleGraph/IcicleGraphArrow/useNodeColor.d.ts +1 -3
  39. package/dist/ProfileIcicleGraph/IcicleGraphArrow/useNodeColor.d.ts.map +1 -1
  40. package/dist/ProfileIcicleGraph/IcicleGraphArrow/useNodeColor.js +2 -5
  41. package/dist/ProfileIcicleGraph/index.d.ts +1 -3
  42. package/dist/ProfileIcicleGraph/index.d.ts.map +1 -1
  43. package/dist/ProfileIcicleGraph/index.js +21 -48
  44. package/dist/ProfileMetricsGraph/index.js +1 -2
  45. package/dist/ProfileView/FilterByFunctionButton.d.ts +1 -4
  46. package/dist/ProfileView/FilterByFunctionButton.d.ts.map +1 -1
  47. package/dist/ProfileView/FilterByFunctionButton.js +12 -3
  48. package/dist/ProfileView/ViewSelector.d.ts +1 -3
  49. package/dist/ProfileView/ViewSelector.d.ts.map +1 -1
  50. package/dist/ProfileView/ViewSelector.js +3 -4
  51. package/dist/ProfileView/VisualizationPanel.d.ts +0 -2
  52. package/dist/ProfileView/VisualizationPanel.d.ts.map +1 -1
  53. package/dist/ProfileView/VisualizationPanel.js +2 -2
  54. package/dist/ProfileView/index.d.ts +1 -5
  55. package/dist/ProfileView/index.d.ts.map +1 -1
  56. package/dist/ProfileView/index.js +11 -18
  57. package/dist/ProfileViewWithData.d.ts +1 -3
  58. package/dist/ProfileViewWithData.d.ts.map +1 -1
  59. package/dist/ProfileViewWithData.js +15 -12
  60. package/dist/SourceView/index.js +1 -1
  61. package/dist/SourceView/useSelectedLineRange.js +1 -1
  62. package/dist/Table/index.d.ts +1 -2
  63. package/dist/Table/index.d.ts.map +1 -1
  64. package/dist/Table/index.js +9 -25
  65. package/dist/TopTable/index.d.ts.map +1 -1
  66. package/dist/TopTable/index.js +3 -7
  67. package/dist/index.d.ts +3 -0
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +3 -0
  70. package/dist/styles.css +1 -1
  71. package/package.json +7 -7
  72. package/src/Callgraph/index.tsx +3 -3
  73. package/src/GraphTooltipArrow/Content.tsx +7 -36
  74. package/src/GraphTooltipArrow/DockedGraphTooltip/index.tsx +8 -16
  75. package/src/GraphTooltipArrow/useGraphTooltip/index.ts +10 -42
  76. package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +6 -22
  77. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +2 -3
  78. package/src/ProfileExplorer/ProfileExplorerSingle.tsx +1 -5
  79. package/src/ProfileExplorer/index.tsx +0 -8
  80. package/src/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.tsx +2 -4
  81. package/src/ProfileIcicleGraph/IcicleGraph/index.tsx +5 -8
  82. package/src/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.tsx +8 -27
  83. package/src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx +5 -4
  84. package/src/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.tsx +9 -54
  85. package/src/ProfileIcicleGraph/IcicleGraphArrow/index.tsx +9 -20
  86. package/src/ProfileIcicleGraph/IcicleGraphArrow/useNodeColor.ts +1 -9
  87. package/src/ProfileIcicleGraph/index.tsx +21 -67
  88. package/src/ProfileMetricsGraph/index.tsx +2 -2
  89. package/src/ProfileView/FilterByFunctionButton.tsx +15 -9
  90. package/src/ProfileView/ViewSelector.tsx +6 -7
  91. package/src/ProfileView/VisualizationPanel.tsx +1 -9
  92. package/src/ProfileView/index.tsx +8 -23
  93. package/src/ProfileViewWithData.tsx +15 -18
  94. package/src/SourceView/index.tsx +1 -1
  95. package/src/SourceView/useSelectedLineRange.ts +2 -2
  96. package/src/Table/index.tsx +10 -41
  97. package/src/TopTable/index.tsx +3 -8
  98. package/src/index.tsx +4 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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.418](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.417...@parca/profile@0.16.418) (2024-07-29)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## 0.16.417 (2024-07-29)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.16.416](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.415...@parca/profile@0.16.416) (2024-07-23)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -39,8 +39,9 @@ const Callgraph = ({ data, svgString, profileType, width }) => {
39
39
  // ? true
40
40
  // : isSearchMatch(currentSearchString, sourceNode.functionName) &&
41
41
  // isSearchMatch(currentSearchString, targetNode.functionName);
42
- const [rawDashboardItems] = useURLState({ param: 'dashboard_items' });
43
- const dashboardItems = rawDashboardItems !== undefined ? rawDashboardItems : ['icicle'];
42
+ const [dashboardItems] = useURLState('dashboard_items', {
43
+ alwaysReturnArray: true,
44
+ });
44
45
  const isDarkMode = useAppSelector(selectDarkMode);
45
46
  const maxColor = getNewSpanColor(isDarkMode);
46
47
  const minColor = d3.scaleLinear([isDarkMode ? 'black' : 'white', maxColor])(0.3);
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Table } from 'apache-arrow';
3
3
  import { ProfileType } from '@parca/parser';
4
- import { type NavigateFunction } from '@parca/utilities';
5
4
  interface GraphTooltipArrowContentProps {
6
5
  table: Table<any>;
7
6
  profileType?: ProfileType;
@@ -11,8 +10,8 @@ interface GraphTooltipArrowContentProps {
11
10
  row: number | null;
12
11
  level: number;
13
12
  isFixed: boolean;
14
- navigateTo: NavigateFunction;
13
+ compareAbsolute: boolean;
15
14
  }
16
- declare const GraphTooltipArrowContent: ({ table, profileType, unit, total, totalUnfiltered, row, level, isFixed, navigateTo, }: GraphTooltipArrowContentProps) => React.JSX.Element;
15
+ declare const GraphTooltipArrowContent: ({ table, profileType, unit, total, totalUnfiltered, row, level, isFixed, compareAbsolute, }: GraphTooltipArrowContentProps) => React.JSX.Element;
17
16
  export default GraphTooltipArrowContent;
18
17
  //# sourceMappingURL=Content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../src/GraphTooltipArrow/Content.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAc,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAOpE,UAAU,6BAA6B;IACrC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAMD,QAAA,MAAM,wBAAwB,2FAU3B,6BAA6B,KAAG,KAAK,CAAC,GAAG,CAAC,OAqG5C,CAAC;AAmFF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../src/GraphTooltipArrow/Content.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAQ1C,UAAU,6BAA6B;IACrC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAMD,QAAA,MAAM,wBAAwB,gGAU3B,6BAA6B,KAAG,KAAK,CAAC,GAAG,CAAC,OAgF5C,CAAC;AA2EF,eAAe,wBAAwB,CAAC"}
@@ -8,7 +8,7 @@ import { useGraphTooltipMetaInfo } from './useGraphTooltipMetaInfo';
8
8
  const NoData = () => {
9
9
  return _jsx("span", { className: "rounded bg-gray-200 px-2 dark:bg-gray-800", children: "Not available" });
10
10
  };
11
- const GraphTooltipArrowContent = ({ table, profileType, unit, total, totalUnfiltered, row, level, isFixed, navigateTo, }) => {
11
+ const GraphTooltipArrowContent = ({ table, profileType, unit, total, totalUnfiltered, row, level, isFixed, compareAbsolute, }) => {
12
12
  const graphTooltipData = useGraphTooltip({
13
13
  table,
14
14
  profileType,
@@ -17,19 +17,20 @@ const GraphTooltipArrowContent = ({ table, profileType, unit, total, totalUnfilt
17
17
  totalUnfiltered,
18
18
  row,
19
19
  level,
20
+ compareAbsolute,
20
21
  });
21
22
  if (graphTooltipData === null) {
22
23
  return _jsx(_Fragment, {});
23
24
  }
24
- const { name, locationAddress, cumulativeText, cumulativePerSecondText, flatText, flatPerSecondText, diffText, diff, row: rowNumber, } = graphTooltipData;
25
+ const { name, locationAddress, cumulativeText, flatText, diffText, diff, row: rowNumber, } = graphTooltipData;
25
26
  return (_jsx("div", { className: `flex text-sm ${isFixed ? 'w-full' : ''}`, children: _jsx("div", { className: `m-auto w-full ${isFixed ? 'w-full' : ''}`, children: _jsxs("div", { className: "min-h-52 flex w-[500px] flex-col justify-between rounded-lg border border-gray-300 bg-gray-50 p-3 shadow-lg dark:border-gray-500 dark:bg-gray-900", children: [_jsx("div", { className: "flex flex-row", children: _jsxs("div", { className: "mx-2", children: [_jsx("div", { className: "flex h-10 items-start justify-between gap-4 break-all font-semibold", children: row === 0 ? (_jsx("p", { children: "root" })) : (_jsx("p", { children: name !== ''
26
27
  ? name
27
28
  : locationAddress !== 0n
28
29
  ? hexifyAddress(locationAddress)
29
- : 'unknown' })) }), _jsx("table", { className: "my-2 w-full table-fixed pr-0 text-gray-700 dark:text-gray-300", children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Cumulative" }), _jsx("td", { className: "w-3/4", children: _jsx("div", { children: cumulativeText }) })] }), (profileType?.delta ?? false) ? (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4" }), _jsx("td", { className: "w-3/4", children: _jsx("div", { children: cumulativePerSecondText }) })] })) : (_jsx(_Fragment, {})), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "Flat" }), _jsx("td", { className: "w-3/4 pt-2", children: _jsx("div", { children: flatText }) })] }), (profileType?.delta ?? false) ? (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4" }), _jsx("td", { className: "w-3/4", children: _jsx("div", { children: flatPerSecondText }) })] })) : (_jsx(_Fragment, {})), diff !== 0n && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "Diff" }), _jsx("td", { className: "w-3/4 pt-2", children: _jsx("div", { children: diffText }) })] })), _jsx(TooltipMetaInfo, { table: table, row: rowNumber, navigateTo: navigateTo })] }) })] }) }), _jsxs("div", { className: "flex w-full items-center gap-1 text-xs text-gray-500", children: [_jsx(Icon, { icon: "iconoir:mouse-button-right" }), _jsx("div", { children: "Right click to show context menu" })] })] }) }) }));
30
+ : 'unknown' })) }), _jsx("table", { className: "my-2 w-full table-fixed pr-0 text-gray-700 dark:text-gray-300", children: _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { className: "w-1/4", children: "Cumulative" }), _jsx("td", { className: "w-3/4", children: _jsx("div", { children: cumulativeText }) })] }), _jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "Flat" }), _jsx("td", { className: "w-3/4 pt-2", children: _jsx("div", { children: flatText }) })] }), diff !== 0n && (_jsxs("tr", { children: [_jsx("td", { className: "w-1/4 pt-2", children: "Diff" }), _jsx("td", { className: "w-3/4 pt-2", children: _jsx("div", { children: diffText }) })] })), _jsx(TooltipMetaInfo, { table: table, row: rowNumber })] }) })] }) }), _jsxs("div", { className: "flex w-full items-center gap-1 text-xs text-gray-500", children: [_jsx(Icon, { icon: "iconoir:mouse-button-right" }), _jsx("div", { children: "Right click to show context menu" })] })] }) }) }));
30
31
  };
31
- const TooltipMetaInfo = ({ table, row, navigateTo, }) => {
32
- const { labelPairs, functionFilename, file, locationAddress, mappingFile, mappingBuildID, inlined, } = useGraphTooltipMetaInfo({ table, row, navigateTo });
32
+ const TooltipMetaInfo = ({ table, row }) => {
33
+ const { labelPairs, functionFilename, file, locationAddress, mappingFile, mappingBuildID, inlined, } = useGraphTooltipMetaInfo({ table, row });
33
34
  const labels = labelPairs.map((l) => (_jsx("span", { className: "mr-3 inline-block rounded-lg bg-gray-200 px-2 py-1 text-xs font-bold text-gray-700 dark:bg-gray-700 dark:text-gray-400", children: `${l[0]}="${l[1]}"` }, l[0])));
34
35
  const isMappingBuildIDAvailable = mappingBuildID !== null && mappingBuildID !== '';
35
36
  const inlinedText = inlined === null ? 'merged' : inlined ? 'yes' : 'no';
@@ -8,7 +8,8 @@ interface Props {
8
8
  level: number;
9
9
  profileType?: ProfileType;
10
10
  unit?: string;
11
+ compareAbsolute: boolean;
11
12
  }
12
- export declare const DockedGraphTooltip: ({ table, total, totalUnfiltered, row, level, profileType, unit, }: Props) => JSX.Element;
13
+ export declare const DockedGraphTooltip: ({ table, total, totalUnfiltered, row, level, profileType, unit, compareAbsolute, }: Props) => JSX.Element;
13
14
  export {};
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/DockedGraphTooltip/index.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAKnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAO1C,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAuBD,eAAO,MAAM,kBAAkB,sEAQ5B,KAAK,KAAG,GAAG,CAAC,OAkHd,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/DockedGraphTooltip/index.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAKnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAO1C,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;CAC1B;AAuBD,eAAO,MAAM,kBAAkB,uFAS5B,KAAK,KAAG,GAAG,CAAC,OAwGd,CAAC"}
@@ -25,9 +25,9 @@ const InfoSection = ({ title, value, minWidth = '', }) => {
25
25
  const NoData = () => {
26
26
  return _jsx("span", { className: "rounded bg-gray-200 px-2 dark:bg-gray-800", children: "Not available" });
27
27
  };
28
- export const DockedGraphTooltip = ({ table, total, totalUnfiltered, row, level, profileType, unit, }) => {
28
+ export const DockedGraphTooltip = ({ table, total, totalUnfiltered, row, level, profileType, unit, compareAbsolute, }) => {
29
29
  let { width } = useWindowSize();
30
- const { profileExplorer, navigateTo } = useParcaContext();
30
+ const { profileExplorer } = useParcaContext();
31
31
  const { PaddingX } = profileExplorer ?? { PaddingX: 0 };
32
32
  width = width - PaddingX - 24;
33
33
  const graphTooltipData = useGraphTooltip({
@@ -38,21 +38,20 @@ export const DockedGraphTooltip = ({ table, total, totalUnfiltered, row, level,
38
38
  totalUnfiltered,
39
39
  row,
40
40
  level,
41
+ compareAbsolute,
41
42
  });
42
- const { labelPairs, functionFilename, file, locationAddress, mappingFile, mappingBuildID, inlined, } = useGraphTooltipMetaInfo({ table, row: row ?? 0, navigateTo });
43
+ const { labelPairs, functionFilename, file, locationAddress, mappingFile, mappingBuildID, inlined, } = useGraphTooltipMetaInfo({ table, row: row ?? 0 });
43
44
  if (graphTooltipData === null) {
44
45
  return _jsx(_Fragment, {});
45
46
  }
46
- const { name, cumulativeText, cumulativePerSecondText, flatText, flatPerSecondText, diffText, diff, } = graphTooltipData;
47
+ const { name, cumulativeText, flatText, diffText, diff } = graphTooltipData;
47
48
  const labels = labelPairs.map((l) => (_jsx("span", { className: "mr-3 inline-block rounded-lg bg-gray-200 px-2 py-1 text-xs font-bold text-gray-700 dark:bg-gray-700 dark:text-gray-400", children: `${l[0]}="${l[1]}"` }, l[0])));
48
49
  const isMappingBuildIDAvailable = mappingBuildID !== null && mappingBuildID !== '';
49
50
  const inlinedText = inlined === null ? 'merged' : inlined ? 'yes' : 'no';
50
51
  const addressText = locationAddress !== 0n ? hexifyAddress(locationAddress) : _jsx(NoData, {});
51
- const cumulativeTextBoth = `${cumulativeText}\n${cumulativePerSecondText}`;
52
- const flatTextBoth = `${flatText}\n${flatPerSecondText}`;
53
52
  return (_jsxs("div", { className: "fixed bottom-0 z-20 overflow-hidden rounded-t-lg border-l border-r border-t border-gray-400 bg-white bg-opacity-90 px-8 py-3 dark:border-gray-600 dark:bg-black dark:bg-opacity-80", style: { width }, children: [_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx("div", { className: "flex justify-between gap-4", children: row === 0 ? (_jsx("p", { children: "root" })) : (_jsx("p", { children: name !== ''
54
53
  ? name
55
54
  : locationAddress !== 0n
56
55
  ? hexifyAddress(locationAddress)
57
- : 'unknown' })) }), _jsxs("div", { className: "flex justify-between gap-3", children: [_jsx(InfoSection, { title: "Cumulative", value: cumulativeTextBoth, minWidth: "w-44" }), _jsx(InfoSection, { title: "Flat", value: flatTextBoth, minWidth: "w-44" }), diff !== 0n ? _jsx(InfoSection, { title: "Diff", value: diffText, minWidth: "w-44" }) : null, _jsx(InfoSection, { title: "File", value: functionFilename !== '' ? truncateStringReverse(file, 45) : _jsx(NoData, {}), minWidth: 'w-[460px]' }), _jsx(InfoSection, { title: "Address", value: addressText, minWidth: "w-44" }), _jsx(InfoSection, { title: "Inlined", value: inlinedText, minWidth: "w-44" }), _jsx(InfoSection, { title: "Binary", value: (mappingFile != null ? getLastItem(mappingFile) : null) ?? _jsx(NoData, {}), minWidth: "w-44" }), _jsx(InfoSection, { title: "Build ID", value: isMappingBuildIDAvailable ? (_jsx("div", { children: truncateString(mappingBuildID, 28) })) : (_jsx(NoData, {})) })] }), _jsx("div", { children: _jsx("div", { className: "flex h-5 gap-1", children: labels }) })] }), _jsxs("div", { className: "flex w-full items-center gap-1 text-xs text-gray-500", children: [_jsx(Icon, { icon: "iconoir:mouse-button-right" }), _jsx("div", { children: "Right click to show context menu" })] })] }));
56
+ : 'unknown' })) }), _jsxs("div", { className: "flex justify-between gap-3", children: [_jsx(InfoSection, { title: "Cumulative", value: cumulativeText, minWidth: "w-44" }), _jsx(InfoSection, { title: "Flat", value: flatText, minWidth: "w-44" }), diff !== 0n ? _jsx(InfoSection, { title: "Diff", value: diffText, minWidth: "w-44" }) : null, _jsx(InfoSection, { title: "File", value: functionFilename !== '' ? truncateStringReverse(file, 45) : _jsx(NoData, {}), minWidth: 'w-[460px]' }), _jsx(InfoSection, { title: "Address", value: addressText, minWidth: "w-44" }), _jsx(InfoSection, { title: "Inlined", value: inlinedText, minWidth: "w-44" }), _jsx(InfoSection, { title: "Binary", value: (mappingFile != null ? getLastItem(mappingFile) : null) ?? _jsx(NoData, {}), minWidth: "w-44" }), _jsx(InfoSection, { title: "Build ID", value: isMappingBuildIDAvailable ? (_jsx("div", { children: truncateString(mappingBuildID, 28) })) : (_jsx(NoData, {})) })] }), _jsx("div", { children: _jsx("div", { className: "flex h-5 gap-1", children: labels }) })] }), _jsxs("div", { className: "flex w-full items-center gap-1 text-xs text-gray-500", children: [_jsx(Icon, { icon: "iconoir:mouse-button-right" }), _jsx("div", { children: "Right click to show context menu" })] })] }));
58
57
  };
@@ -6,6 +6,7 @@ interface Props {
6
6
  unit?: string;
7
7
  total: bigint;
8
8
  totalUnfiltered: bigint;
9
+ compareAbsolute: boolean;
9
10
  row: number | null;
10
11
  level: number;
11
12
  }
@@ -13,13 +14,11 @@ interface GraphTooltipData {
13
14
  name: string;
14
15
  locationAddress: bigint;
15
16
  cumulativeText: string;
16
- cumulativePerSecondText: string;
17
17
  flatText: string;
18
- flatPerSecondText: string;
19
18
  diffText: string;
20
19
  diff: bigint;
21
20
  row: number;
22
21
  }
23
- export declare const useGraphTooltip: ({ table, profileType, unit, total, totalUnfiltered, row, level, }: Props) => GraphTooltipData | null;
22
+ export declare const useGraphTooltip: ({ table, profileType, unit, compareAbsolute, total, totalUnfiltered, row, level, }: Props) => GraphTooltipData | null;
24
23
  export {};
25
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/useGraphTooltip/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAkB1C,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,eAAe,sEAQzB,KAAK,KAAG,gBAAgB,GAAG,IAkE7B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/useGraphTooltip/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAW1C,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,eAAe,uFASzB,KAAK,KAAG,gBAAgB,GAAG,IAyC7B,CAAC"}
@@ -11,9 +11,9 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { divide, valueFormatter } from '@parca/utilities';
14
- import { FIELD_CUMULATIVE, FIELD_CUMULATIVE_PER_SECOND, FIELD_DIFF, FIELD_DIFF_PER_SECOND, FIELD_FLAT, FIELD_FLAT_PER_SECOND, FIELD_LOCATION_ADDRESS, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
15
- import { getTextForCumulative, getTextForCumulativePerSecond, nodeLabel, } from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
16
- export const useGraphTooltip = ({ table, profileType, unit, total, totalUnfiltered, row, level, }) => {
14
+ import { FIELD_CUMULATIVE, FIELD_DIFF, FIELD_FLAT, FIELD_LOCATION_ADDRESS, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
15
+ import { getTextForCumulative, nodeLabel } from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
16
+ export const useGraphTooltip = ({ table, profileType, unit, compareAbsolute, total, totalUnfiltered, row, level, }) => {
17
17
  if (row === null || profileType === undefined) {
18
18
  return null;
19
19
  }
@@ -22,46 +22,25 @@ export const useGraphTooltip = ({ table, profileType, unit, total, totalUnfilter
22
22
  const cumulative = table.getChild(FIELD_CUMULATIVE)?.get(row) !== null
23
23
  ? BigInt(table.getChild(FIELD_CUMULATIVE)?.get(row))
24
24
  : 0n;
25
- const cumulativePerSecond = table.getChild(FIELD_CUMULATIVE_PER_SECOND)?.get(row) !== null
26
- ? table.getChild(FIELD_CUMULATIVE_PER_SECOND)?.get(row)
27
- : 0;
28
25
  const flat = table.getChild(FIELD_FLAT)?.get(row) !== null
29
26
  ? BigInt(table.getChild(FIELD_FLAT)?.get(row))
30
27
  : 0n;
31
- const flatPerSecond = table.getChild(FIELD_FLAT_PER_SECOND)?.get(row) !== null
32
- ? table.getChild(FIELD_FLAT_PER_SECOND)?.get(row)
33
- : 0;
34
28
  const diff = table.getChild(FIELD_DIFF)?.get(row) !== null
35
29
  ? BigInt(table.getChild(FIELD_DIFF)?.get(row))
36
30
  : 0n;
37
- const diffPerSecond = table.getChild(FIELD_DIFF_PER_SECOND)?.get(row) !== null
38
- ? table.getChild(FIELD_DIFF_PER_SECOND)?.get(row)
39
- : 0;
40
31
  let diffText = '';
41
- if (profileType?.delta ?? false) {
42
- const prevValue = cumulativePerSecond - diffPerSecond;
43
- const diffRatio = diffPerSecond !== 0 ? diffPerSecond / prevValue : 0;
44
- const diffSign = diffPerSecond > 0 ? '+' : '';
45
- const diffValueText = diffSign + valueFormatter(diffPerSecond, 'CPU Cores', 5);
46
- const diffPercentageText = diffSign + (diffRatio * 100).toFixed(2) + '%';
47
- diffText = `${diffValueText} (${diffPercentageText})`;
48
- }
49
- else {
50
- const prevValue = cumulative - diff;
51
- const diffRatio = diff !== 0n ? divide(diff, prevValue) : 0;
52
- const diffSign = diff > 0 ? '+' : '';
53
- const diffValueText = diffSign + valueFormatter(diff, unit, 1);
54
- const diffPercentageText = diffSign + (diffRatio * 100).toFixed(2) + '%';
55
- diffText = `${diffValueText} (${diffPercentageText})`;
56
- }
32
+ const prevValue = cumulative - diff;
33
+ const diffRatio = diff !== 0n ? divide(diff, prevValue) : 0;
34
+ const diffSign = diff > 0 ? '+' : '';
35
+ const diffValueText = diffSign + valueFormatter(diff, unit, 1);
36
+ const diffPercentageText = diffSign + (diffRatio * 100).toFixed(2) + '%';
37
+ diffText = compareAbsolute ? `${diffValueText} (${diffPercentageText})` : diffPercentageText;
57
38
  const name = nodeLabel(table, row, level, false);
58
39
  return {
59
40
  name,
60
41
  locationAddress,
61
42
  cumulativeText: getTextForCumulative(cumulative, totalUnfiltered, total, unit ?? ''),
62
- cumulativePerSecondText: getTextForCumulativePerSecond(cumulativePerSecond, unit ?? 'CPU Cores'),
63
43
  flatText: getTextForCumulative(flat, totalUnfiltered, total, unit ?? ''),
64
- flatPerSecondText: getTextForCumulativePerSecond(flatPerSecond, unit ?? 'CPU Cores'),
65
44
  diffText,
66
45
  diff,
67
46
  row,
@@ -1,9 +1,7 @@
1
1
  import { Table } from 'apache-arrow';
2
- import type { NavigateFunction } from '@parca/utilities';
3
2
  interface Props {
4
3
  table: Table<any>;
5
4
  row: number;
6
- navigateTo: NavigateFunction;
7
5
  }
8
6
  interface GraphTooltipMetaInfoData {
9
7
  labelPairs: Array<[string, string]>;
@@ -17,6 +15,6 @@ interface GraphTooltipMetaInfoData {
17
15
  mappingBuildID: string | null;
18
16
  inlined: boolean | null;
19
17
  }
20
- export declare const useGraphTooltipMetaInfo: ({ table, row, navigateTo, }: Props) => GraphTooltipMetaInfoData;
18
+ export declare const useGraphTooltipMetaInfo: ({ table, row }: Props) => GraphTooltipMetaInfoData;
21
19
  export {};
22
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAInC,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAiBvD,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,UAAU,wBAAwB;IAChC,UAAU,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,uBAAuB,gCAIjC,KAAK,KAAG,wBAwGV,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAoBnC,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,wBAAwB;IAChC,UAAU,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,uBAAuB,mBAAkB,KAAK,KAAG,wBA8F7D,CAAC"}
@@ -16,7 +16,7 @@ import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_START_LINE, FIELD_FUNCTION_SYS
16
16
  import { arrowToString } from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
17
17
  import { useProfileViewContext } from '../../ProfileView/ProfileViewContext';
18
18
  import { useQuery } from '../../useQuery';
19
- export const useGraphTooltipMetaInfo = ({ table, row, navigateTo, }) => {
19
+ export const useGraphTooltipMetaInfo = ({ table, row }) => {
20
20
  const mappingFile = arrowToString(table.getChild(FIELD_MAPPING_FILE)?.get(row));
21
21
  const mappingBuildID = arrowToString(table.getChild(FIELD_MAPPING_BUILD_ID)?.get(row));
22
22
  const locationAddress = table.getChild(FIELD_LOCATION_ADDRESS)?.get(row) ?? 0n;
@@ -54,25 +54,15 @@ export const useGraphTooltipMetaInfo = ({ table, row, navigateTo, }) => {
54
54
  arrowToString(table.getChild(field.name)?.get(row)) ?? '',
55
55
  ])
56
56
  .filter(value => value[1] !== '');
57
- const [dashboardItems, setDashboardItems] = useURLState({
58
- param: 'dashboard_items',
59
- navigateTo,
57
+ const [dashboardItems, setDashboardItems] = useURLState('dashboard_items', {
58
+ alwaysReturnArray: true,
60
59
  });
61
60
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
62
- const [unusedBuildId, setSourceBuildId] = useURLState({
63
- param: 'source_buildid',
64
- navigateTo,
65
- });
61
+ const [unusedBuildId, setSourceBuildId] = useURLState('source_buildid');
66
62
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
67
- const [unusedFilename, setSourceFilename] = useURLState({
68
- param: 'source_filename',
69
- navigateTo,
70
- });
63
+ const [unusedFilename, setSourceFilename] = useURLState('source_filename');
71
64
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
72
- const [unusedLine, setSourceLine] = useURLState({
73
- param: 'source_line',
74
- navigateTo,
75
- });
65
+ const [unusedLine, setSourceLine] = useURLState('source_line');
76
66
  const openFile = () => {
77
67
  setDashboardItems([dashboardItems[0], 'source']);
78
68
  if (mappingBuildID != null) {
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileExplorerCompare.d.ts","sourceRoot":"","sources":["../../src/ProfileExplorer/ProfileExplorerCompare.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAoB,gBAAgB,EAAsB,MAAM,IAAI,CAAC;AAC5E,OAAwB,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAEnE,UAAU,2BAA2B;IACnC,WAAW,EAAE,kBAAkB,CAAC;IAEhC,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,cAAc,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACnD,cAAc,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACnD,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,QAAA,MAAM,sBAAsB,+IAYzB,2BAA2B,KAAG,GAAG,CAAC,OAwEpC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"ProfileExplorerCompare.d.ts","sourceRoot":"","sources":["../../src/ProfileExplorer/ProfileExplorerCompare.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAoB,gBAAgB,EAAsB,MAAM,IAAI,CAAC;AAC5E,OAAwB,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAEnE,UAAU,2BAA2B;IACnC,WAAW,EAAE,kBAAkB,CAAC;IAEhC,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,cAAc,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACnD,cAAc,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACnD,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,QAAA,MAAM,sBAAsB,+IAYzB,2BAA2B,KAAG,GAAG,CAAC,OAuEpC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -10,8 +10,8 @@ const ProfileExplorerCompare = ({ queryClient, queryA, queryB, profileA, profile
10
10
  const closeProfileB = () => {
11
11
  closeProfile('B');
12
12
  };
13
- const [compareAbsolute] = useURLState({ param: 'compare_absolute', navigateTo });
14
- const [functionFilter] = useURLState({ param: 'filter_by_function', navigateTo });
15
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex justify-between gap-2", children: [_jsx(Card, { className: "mt-2 p-2", children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: queryA, profileSelection: profileA, selectProfile: selectProfileA, selectQuery: selectQueryA, closeProfile: closeProfileA, enforcedProfileName: '', comparing: true, navigateTo: navigateTo, suffix: "_a" }) }), _jsx(Card, { className: "mt-2 p-2", children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: queryB, profileSelection: profileB, selectProfile: selectProfileB, selectQuery: selectQueryB, closeProfile: closeProfileB, enforcedProfileName: Query.parse(queryA.expression).profileName(), comparing: true, navigateTo: navigateTo, suffix: "_b" }) })] }), _jsx("div", { className: "grid grid-cols-1", children: profileA != null && profileB != null ? (_jsx("div", { children: _jsx(Card, { className: "mt-2 px-6 py-4", children: _jsx(ProfileViewWithData, { navigateTo: navigateTo, queryClient: queryClient, profileSource: new ProfileDiffSource(profileA.ProfileSource(), profileB.ProfileSource(), Array.isArray(functionFilter) ? functionFilter[0] : functionFilter, compareAbsolute === 'true') }) }) })) : (_jsx("div", { children: _jsx("div", { className: "my-20 text-center", children: _jsx("p", { children: "Select a profile on both sides." }) }) })) })] }));
13
+ const [compareAbsolute] = useURLState('compare_absolute');
14
+ const [functionFilter] = useURLState('filter_by_function');
15
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex justify-between gap-2", children: [_jsx(Card, { className: "mt-2 p-2", children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: queryA, profileSelection: profileA, selectProfile: selectProfileA, selectQuery: selectQueryA, closeProfile: closeProfileA, enforcedProfileName: '', comparing: true, navigateTo: navigateTo, suffix: "_a" }) }), _jsx(Card, { className: "mt-2 p-2", children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: queryB, profileSelection: profileB, selectProfile: selectProfileB, selectQuery: selectQueryB, closeProfile: closeProfileB, enforcedProfileName: Query.parse(queryA.expression).profileName(), comparing: true, navigateTo: navigateTo, suffix: "_b" }) })] }), _jsx("div", { className: "grid grid-cols-1", children: profileA != null && profileB != null ? (_jsx("div", { children: _jsx(Card, { className: "mt-2 px-6 py-4", children: _jsx(ProfileViewWithData, { queryClient: queryClient, profileSource: new ProfileDiffSource(profileA.ProfileSource(), profileB.ProfileSource(), Array.isArray(functionFilter) ? functionFilter[0] : functionFilter, compareAbsolute === 'true') }) }) })) : (_jsx("div", { children: _jsx("div", { className: "my-20 text-center", children: _jsx("p", { children: "Select a profile on both sides." }) }) })) })] }));
16
16
  };
17
17
  export default ProfileExplorerCompare;
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileExplorerSingle.d.ts","sourceRoot":"","sources":["../../src/ProfileExplorer/ProfileExplorerSingle.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAC,gBAAgB,EAAsB,MAAM,IAAI,CAAC;AACzD,OAAwB,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAEnE,UAAU,0BAA0B;IAClC,WAAW,EAAE,kBAAkB,CAAC;IAChC,KAAK,EAAE,cAAc,CAAC;IACtB,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,aAAa,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,QAAA,MAAM,qBAAqB,6EAOxB,0BAA0B,KAAG,GAAG,CAAC,OA8BnC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"ProfileExplorerSingle.d.ts","sourceRoot":"","sources":["../../src/ProfileExplorer/ProfileExplorerSingle.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAC,gBAAgB,EAAsB,MAAM,IAAI,CAAC;AACzD,OAAwB,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAEnE,UAAU,0BAA0B;IAClC,WAAW,EAAE,kBAAkB,CAAC;IAChC,KAAK,EAAE,cAAc,CAAC;IACtB,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,aAAa,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,QAAA,MAAM,qBAAqB,6EAOxB,0BAA0B,KAAG,GAAG,CAAC,OA0BnC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -3,6 +3,6 @@ import { Card } from '@parca/components';
3
3
  import { ProfileViewWithData } from '..';
4
4
  import ProfileSelector from '../ProfileSelector';
5
5
  const ProfileExplorerSingle = ({ queryClient, query, selectQuery, selectProfile, profile, navigateTo, }) => {
6
- return (_jsxs(_Fragment, { children: [_jsx(Card, { className: "mt-2 px-6 py-4", children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: query, selectQuery: selectQuery, selectProfile: selectProfile, closeProfile: () => { }, profileSelection: profile, comparing: false, enforcedProfileName: '', navigateTo: navigateTo, suffix: "_a" }) }), profile != null ? (_jsx(Card, { className: "mt-2 px-6 py-4", children: _jsx(ProfileViewWithData, { queryClient: queryClient, profileSource: profile.ProfileSource(), navigateTo: navigateTo }) })) : (_jsx(_Fragment, {}))] }));
6
+ return (_jsxs(_Fragment, { children: [_jsx(Card, { className: "mt-2 px-6 py-4", children: _jsx(ProfileSelector, { queryClient: queryClient, querySelection: query, selectQuery: selectQuery, selectProfile: selectProfile, closeProfile: () => { }, profileSelection: profile, comparing: false, enforcedProfileName: '', navigateTo: navigateTo, suffix: "_a" }) }), profile != null ? (_jsx(Card, { className: "mt-2 px-6 py-4", children: _jsx(ProfileViewWithData, { queryClient: queryClient, profileSource: profile.ProfileSource() }) })) : (_jsx(_Fragment, {}))] }));
7
7
  };
8
8
  export default ProfileExplorerSingle;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileExplorer/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,EAA4B,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAQlF,UAAU,oBAAoB;IAC5B,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,GAAG,CAAC;IACjB,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAaD,eAAO,MAAM,sBAAsB,eAAgB,MAAM,GAAG,EAAE,KAAG,MAGhE,CAAC;AAyWF,QAAA,MAAM,eAAe,8CAIlB,oBAAoB,KAAG,GAAG,CAAC,OAkB7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileExplorer/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,EAA4B,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAQlF,UAAU,oBAAoB;IAC5B,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,GAAG,CAAC;IACjB,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAaD,eAAO,MAAM,sBAAsB,eAAgB,MAAM,GAAG,EAAE,KAAG,MAGhE,CAAC;AAiWF,QAAA,MAAM,eAAe,8CAIlB,oBAAoB,KAAG,GAAG,CAAC,OAkB7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -28,7 +28,6 @@ export const getExpressionAsAString = (expression) => {
28
28
  const x = Array.isArray(expression) ? expression.join() : expression;
29
29
  return x;
30
30
  };
31
- const DEFAULT_DASHBOARD_ITEMS = ['icicle'];
32
31
  /* eslint-disable @typescript-eslint/naming-convention */
33
32
  const sanitizeDateRange = (time_selection_a, from_a, to_a) => {
34
33
  const range = DateTimeRange.fromRangeKey(time_selection_a, from_a, to_a);
@@ -80,7 +79,7 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
80
79
  }
81
80
  }, [profileTypesError, onError]);
82
81
  /* eslint-disable @typescript-eslint/naming-convention */
83
- let { from_a, to_a, merge_from_a, merge_to_a, time_selection_a, compare_a, sum_by_a, from_b, to_b, merge_from_b, merge_to_b, time_selection_b, compare_b, sum_by_b, filter_by_function, dashboard_items, } = queryParams;
82
+ let { from_a, to_a, merge_from_a, merge_to_a, time_selection_a, compare_a, sum_by_a, from_b, to_b, merge_from_b, merge_to_b, time_selection_b, compare_b, sum_by_b, filter_by_function, } = queryParams;
84
83
  // eslint-disable-next-line @typescript-eslint/naming-convention
85
84
  const expression_a = getExpressionAsAString(queryParams.expression_a);
86
85
  // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -136,7 +135,6 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
136
135
  return navigateTo('/', {
137
136
  ...queryParams,
138
137
  ...SuffixParams(p.HistoryParams(), suffix),
139
- dashboard_items: dashboard_items ?? DEFAULT_DASHBOARD_ITEMS,
140
138
  });
141
139
  };
142
140
  const selectProfileA = (p) => {
@@ -173,7 +171,6 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
173
171
  to_a: q.to.toString(),
174
172
  time_selection_a: q.timeSelection,
175
173
  sum_by_a: sumByToParam(q.sumBy),
176
- dashboard_items: dashboard_items ?? DEFAULT_DASHBOARD_ITEMS,
177
174
  ...mergeParams,
178
175
  },
179
176
  }));
@@ -183,7 +180,6 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
183
180
  return navigateTo('/', {
184
181
  ...queryParams,
185
182
  ...SuffixParams(p.HistoryParams(), '_a'),
186
- dashboard_items: dashboard_items ?? DEFAULT_DASHBOARD_ITEMS,
187
183
  });
188
184
  };
189
185
  return (_jsx(ProfileExplorerSingle, { queryClient: queryClient, query: queryA, profile: profileA, selectQuery: selectQuery, selectProfile: selectProfile, navigateTo: navigateTo }));
@@ -218,7 +214,6 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
218
214
  time_selection_a: q.timeSelection,
219
215
  sum_by_a: sumByToParam(q.sumBy),
220
216
  filter_by_function: filter_by_function ?? '',
221
- dashboard_items: dashboard_items ?? DEFAULT_DASHBOARD_ITEMS,
222
217
  ...mergeParams,
223
218
  },
224
219
  }));
@@ -246,7 +241,6 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
246
241
  time_selection_b: q.timeSelection,
247
242
  sum_by_b: sumByToParam(q.sumBy),
248
243
  filter_by_function: filter_by_function ?? '',
249
- dashboard_items: dashboard_items ?? DEFAULT_DASHBOARD_ITEMS,
250
244
  ...mergeParams,
251
245
  },
252
246
  }));
@@ -1,8 +1,6 @@
1
- import type { NavigateFunction } from '@parca/utilities';
2
1
  interface Props {
3
- navigateTo?: NavigateFunction;
4
2
  compareMode?: boolean;
5
3
  }
6
- declare const ColorStackLegend: ({ navigateTo, compareMode }: Props) => JSX.Element;
4
+ declare const ColorStackLegend: ({ compareMode }: Props) => JSX.Element;
7
5
  export default ColorStackLegend;
8
6
  //# sourceMappingURL=ColorStackLegend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorStackLegend.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,UAAU,KAAK;IACb,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,gBAAgB,gCAAuC,KAAK,KAAG,GAAG,CAAC,OAgExE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"ColorStackLegend.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.tsx"],"names":[],"mappings":"AAsBA,UAAU,KAAK;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,gBAAgB,oBAA2B,KAAK,KAAG,GAAG,CAAC,OAgE5D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -17,9 +17,9 @@ import cx from 'classnames';
17
17
  import { useURLState } from '@parca/components';
18
18
  import { USER_PREFERENCES, useUserPreference } from '@parca/hooks';
19
19
  import { EVERYTHING_ELSE, selectStackColors, useAppSelector } from '@parca/store';
20
- const ColorStackLegend = ({ navigateTo, compareMode = false }) => {
20
+ const ColorStackLegend = ({ compareMode = false }) => {
21
21
  const [colorProfileName] = useUserPreference(USER_PREFERENCES.FLAMEGRAPH_COLOR_PROFILE.key);
22
- const [currentSearchString, setSearchString] = useURLState({ param: 'search_string', navigateTo });
22
+ const [currentSearchString, setSearchString] = useURLState('search_string');
23
23
  const stackColors = useAppSelector(selectStackColors);
24
24
  const stackColorArray = useMemo(() => {
25
25
  return Object.entries(stackColors).sort(([featureA], [featureB]) => {
@@ -1,6 +1,5 @@
1
1
  import { Flamegraph } from '@parca/client';
2
2
  import { ProfileType } from '@parca/parser';
3
- import { type NavigateFunction } from '@parca/utilities';
4
3
  interface IcicleGraphProps {
5
4
  graph: Flamegraph;
6
5
  total: bigint;
@@ -9,7 +8,6 @@ interface IcicleGraphProps {
9
8
  width?: number;
10
9
  curPath: string[];
11
10
  setCurPath: (path: string[]) => void;
12
- navigateTo?: NavigateFunction;
13
11
  }
14
12
  export declare const IcicleGraph: import("react").NamedExoticComponent<IcicleGraphProps>;
15
13
  export default IcicleGraph;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraph/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAgC,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAQtF,UAAU,gBAAgB;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW,wDAsFtB,CAAC;AAEH,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraph/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAU1C,UAAU,gBAAgB;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,WAAW,wDAmFtB,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -12,6 +12,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
  import { memo, useEffect, useMemo, useRef, useState } from 'react';
15
+ import { useURLState } from '@parca/components';
15
16
  import { setHoveringNode, useAppDispatch } from '@parca/store';
16
17
  import { scaleLinear, selectQueryParam } from '@parca/utilities';
17
18
  import GraphTooltip from '../../GraphTooltip';
@@ -19,13 +20,13 @@ import { useProfileViewContext } from '../../ProfileView/ProfileViewContext';
19
20
  import ColorStackLegend from './ColorStackLegend';
20
21
  import { IcicleNode, RowHeight } from './IcicleGraphNodes';
21
22
  import useColoredGraph from './useColoredGraph';
22
- export const IcicleGraph = memo(function IcicleGraph({ graph, total, filtered, width, setCurPath, curPath, profileType, navigateTo, }) {
23
+ export const IcicleGraph = memo(function IcicleGraph({ graph, total, filtered, width, setCurPath, curPath, profileType, }) {
23
24
  const dispatch = useAppDispatch();
24
25
  const [height, setHeight] = useState(0);
25
26
  const svg = useRef(null);
26
27
  const ref = useRef(null);
27
28
  const coloredGraph = useColoredGraph(graph);
28
- const currentSearchString = selectQueryParam('search_string') ?? '';
29
+ const [currentSearchString] = useURLState('search_string');
29
30
  const { compareMode } = useProfileViewContext();
30
31
  const isColorStackLegendEnabled = selectQueryParam('color_stack_legend') === 'true';
31
32
  useEffect(() => {
@@ -42,6 +43,6 @@ export const IcicleGraph = memo(function IcicleGraph({ graph, total, filtered, w
42
43
  if (coloredGraph.root === undefined || width === undefined) {
43
44
  return _jsx(_Fragment, {});
44
45
  }
45
- return (_jsxs("div", { onMouseLeave: () => dispatch(setHoveringNode(undefined)), children: [isColorStackLegendEnabled && (_jsx(ColorStackLegend, { navigateTo: navigateTo, compareMode: compareMode })), _jsx(GraphTooltip, { unit: profileType?.sampleUnit ?? '', total: total, totalUnfiltered: total + filtered, contextElement: svg.current, strings: coloredGraph.stringTable, mappings: coloredGraph.mapping, locations: coloredGraph.locations, functions: coloredGraph.function }), _jsx("svg", { className: "font-robotoMono", width: width, height: height, preserveAspectRatio: "xMinYMid", ref: svg, children: _jsx("g", { ref: ref, children: _jsx("g", { transform: 'translate(0, 0)', children: _jsx(IcicleNode, { x: 0, y: 0, totalWidth: width, height: RowHeight, setCurPath: setCurPath, curPath: curPath, data: coloredGraph.root, strings: coloredGraph.stringTable, mappings: coloredGraph.mapping, locations: coloredGraph.locations, functions: coloredGraph.function, total: total, xScale: xScale, path: [], level: 0, isRoot: true, searchString: currentSearchString, compareMode: compareMode }) }) }) })] }));
46
+ return (_jsxs("div", { onMouseLeave: () => dispatch(setHoveringNode(undefined)), children: [isColorStackLegendEnabled && _jsx(ColorStackLegend, { compareMode: compareMode }), _jsx(GraphTooltip, { unit: profileType?.sampleUnit ?? '', total: total, totalUnfiltered: total + filtered, contextElement: svg.current, strings: coloredGraph.stringTable, mappings: coloredGraph.mapping, locations: coloredGraph.locations, functions: coloredGraph.function }), _jsx("svg", { className: "font-robotoMono", width: width, height: height, preserveAspectRatio: "xMinYMid", ref: svg, children: _jsx("g", { ref: ref, children: _jsx("g", { transform: 'translate(0, 0)', children: _jsx(IcicleNode, { x: 0, y: 0, totalWidth: width, height: RowHeight, setCurPath: setCurPath, curPath: curPath, data: coloredGraph.root, strings: coloredGraph.stringTable, mappings: coloredGraph.mapping, locations: coloredGraph.locations, functions: coloredGraph.function, total: total, xScale: xScale, path: [], level: 0, isRoot: true, searchString: currentSearchString, compareMode: compareMode }) }) }) })] }));
46
47
  });
47
48
  export default IcicleGraph;
@@ -1,11 +1,9 @@
1
1
  import React from 'react';
2
- import { type NavigateFunction } from '@parca/utilities';
3
2
  interface Props {
4
3
  mappings?: string[];
5
4
  loading?: boolean;
6
- navigateTo?: NavigateFunction;
7
5
  compareMode?: boolean;
8
6
  }
9
- declare const ColorStackLegend: ({ mappings, navigateTo, compareMode, loading, }: Props) => React.JSX.Element;
7
+ declare const ColorStackLegend: ({ mappings, compareMode, loading }: Props) => React.JSX.Element;
10
8
  export default ColorStackLegend;
11
9
  //# sourceMappingURL=ColorStackLegend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorStackLegend.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAQrC,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAKvD,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,gBAAgB,oDAKnB,KAAK,KAAG,KAAK,CAAC,GAAG,CAAC,OA0GpB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"ColorStackLegend.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAYrC,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,gBAAgB,uCAA8C,KAAK,KAAG,KAAK,CAAC,GAAG,CAAC,OA8FrF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -19,13 +19,13 @@ import { USER_PREFERENCES, useCurrentColorProfile, useUserPreference } from '@pa
19
19
  import { EVERYTHING_ELSE, selectDarkMode, useAppSelector } from '@parca/store';
20
20
  import { getMappingColors } from '.';
21
21
  import useMappingList from './useMappingList';
22
- const ColorStackLegend = ({ mappings, navigateTo, compareMode = false, loading, }) => {
22
+ const ColorStackLegend = ({ mappings, compareMode = false, loading }) => {
23
23
  const isDarkMode = useAppSelector(selectDarkMode);
24
24
  const currentColorProfile = useCurrentColorProfile();
25
25
  const [colorProfileName] = useUserPreference(USER_PREFERENCES.FLAMEGRAPH_COLOR_PROFILE.key);
26
- const [currentSearchString, setSearchString] = useURLState({
27
- param: 'binary_frame_filter',
28
- navigateTo,
26
+ const [currentSearchString, setSearchString] = useURLState('binary_frame_filter', {
27
+ alwaysReturnArray: true,
28
+ defaultValue: [],
29
29
  });
30
30
  const mappingsList = useMappingList(mappings);
31
31
  const mappingColors = useMemo(() => {
@@ -52,10 +52,10 @@ const ColorStackLegend = ({ mappings, navigateTo, compareMode = false, loading,
52
52
  if (colorProfileName === 'default' || compareMode) {
53
53
  return _jsx(_Fragment, {});
54
54
  }
55
- return (_jsx("div", { className: "my-4 flex w-full flex-wrap justify-start", children: stackColorArray.map(([feature, color]) => {
55
+ return (_jsx("div", { className: "my-4 flex w-full flex-wrap justify-start column-gap-2", children: stackColorArray.map(([feature, color]) => {
56
56
  const filteringAllowed = feature !== EVERYTHING_ELSE;
57
57
  const isHighlighted = currentSearchString !== undefined ? currentSearchString.includes(feature) : false;
58
- return (_jsxs("div", { className: cx('flex-no-wrap mb-1 flex w-1/5 items-center justify-between text-ellipsis p-1', {
58
+ return (_jsxs("div", { className: cx('flex-no-wrap mb-1 flex w-[19.25%] items-center justify-between text-ellipsis p-1', {
59
59
  'cursor-pointer': filteringAllowed,
60
60
  'bg-gray-200 dark:bg-gray-800': isHighlighted,
61
61
  }), onClick: () => {
@@ -63,23 +63,11 @@ const ColorStackLegend = ({ mappings, navigateTo, compareMode = false, loading,
63
63
  return;
64
64
  }
65
65
  // Check if the current search string is defined and an array
66
- const updatedSearchString = Array.isArray(currentSearchString)
67
- ? [...currentSearchString, feature] // If array, append the feature
68
- : // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
69
- currentSearchString // If not array, preserve current value
70
- ? currentSearchString.split(',') // If string, split by commas
71
- : [feature]; // If undefined, initialize array with feature
66
+ const updatedSearchString = [...currentSearchString, feature]; // If array, append the feature
72
67
  setSearchString(updatedSearchString);
73
68
  }, children: [_jsxs("div", { className: "flex w-11/12 items-center justify-start", children: [_jsx("div", { className: "flex w-5 items-center", children: _jsx("div", { className: "mr-1 inline-block h-4 w-4", style: { backgroundColor: color } }) }), _jsx("div", { className: "shrink overflow-hidden text-ellipsis whitespace-nowrap text-sm hover:whitespace-normal", children: feature })] }), _jsx("div", { className: "flex w-1/12 justify-end", children: isHighlighted && (_jsx(Icon, { icon: "radix-icons:cross-circled", onClick: e => {
74
- let searchString = [];
75
- if (typeof currentSearchString === 'string') {
76
- searchString.push(currentSearchString);
77
- }
78
- else {
79
- searchString = currentSearchString;
80
- }
81
69
  // remove the current feature from the search string array of strings
82
- setSearchString(searchString.filter((f) => f !== feature));
70
+ setSearchString(currentSearchString.filter((f) => f !== feature));
83
71
  e.stopPropagation();
84
72
  } })) })] }, feature));
85
73
  }) }));