@parca/profile 0.17.2 → 0.17.4
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 +8 -0
- package/dist/GraphTooltipArrow/Content.d.ts +1 -2
- package/dist/GraphTooltipArrow/Content.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/Content.js +1 -2
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.d.ts +1 -2
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +1 -2
- package/dist/GraphTooltipArrow/useGraphTooltip/index.d.ts +1 -2
- package/dist/GraphTooltipArrow/useGraphTooltip/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltip/index.js +2 -2
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.d.ts +2 -6
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.js +4 -5
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.d.ts +20 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.d.ts.map +1 -0
- package/{src/Callgraph/constants.ts → dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.js} +12 -3
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.d.ts +8 -51
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.js +59 -136
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/MemoizedTooltip.d.ts +8 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/MemoizedTooltip.d.ts.map +1 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/MemoizedTooltip.js +40 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/TooltipContext.d.ts +32 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/TooltipContext.d.ts.map +1 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/TooltipContext.js +40 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts +4 -3
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.js +62 -76
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/utils.d.ts +3 -3
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/utils.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/utils.js +9 -7
- package/dist/ProfileIcicleGraph/index.d.ts +3 -6
- package/dist/ProfileIcicleGraph/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/index.js +8 -16
- package/dist/ProfileView/components/DashboardItems/index.d.ts +3 -5
- package/dist/ProfileView/components/DashboardItems/index.d.ts.map +1 -1
- package/dist/ProfileView/components/DashboardItems/index.js +4 -9
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +1 -2
- package/dist/ProfileView/index.d.ts +1 -1
- package/dist/ProfileView/index.d.ts.map +1 -1
- package/dist/ProfileView/index.js +1 -13
- package/dist/ProfileView/types/visualization.d.ts +1 -1
- package/dist/ProfileView/types/visualization.d.ts.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/src/GraphTooltipArrow/Content.tsx +0 -3
- package/src/GraphTooltipArrow/DockedGraphTooltip/index.tsx +0 -3
- package/src/GraphTooltipArrow/useGraphTooltip/index.ts +1 -3
- package/src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx +5 -13
- package/src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.tsx +53 -0
- package/src/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.tsx +96 -310
- package/src/ProfileIcicleGraph/IcicleGraphArrow/MemoizedTooltip.tsx +78 -0
- package/src/ProfileIcicleGraph/IcicleGraphArrow/TooltipContext.tsx +93 -0
- package/src/ProfileIcicleGraph/IcicleGraphArrow/index.tsx +110 -213
- package/src/ProfileIcicleGraph/IcicleGraphArrow/utils.ts +8 -15
- package/src/ProfileIcicleGraph/index.tsx +7 -36
- package/src/ProfileView/components/DashboardItems/index.tsx +2 -27
- package/src/ProfileView/components/Toolbars/index.tsx +0 -2
- package/src/ProfileView/index.tsx +0 -14
- package/src/ProfileView/types/visualization.ts +1 -1
- package/src/index.tsx +0 -5
- package/dist/Callgraph/constants.d.ts +0 -3
- package/dist/Callgraph/constants.d.ts.map +0 -1
- package/dist/Callgraph/constants.js +0 -14
- package/dist/Callgraph/index.d.ts +0 -11
- package/dist/Callgraph/index.d.ts.map +0 -1
- package/dist/Callgraph/index.js +0 -104
- package/dist/Callgraph/mockData/index.d.ts +0 -149
- package/dist/Callgraph/mockData/index.d.ts.map +0 -1
- package/dist/Callgraph/mockData/index.js +0 -594
- package/dist/Callgraph/utils.d.ts +0 -20
- package/dist/Callgraph/utils.d.ts.map +0 -1
- package/dist/Callgraph/utils.js +0 -97
- package/dist/GraphTooltip/ExpandOnHoverValue.d.ts +0 -7
- package/dist/GraphTooltip/ExpandOnHoverValue.d.ts.map +0 -1
- package/dist/GraphTooltip/ExpandOnHoverValue.js +0 -4
- package/dist/GraphTooltip/index.d.ts +0 -41
- package/dist/GraphTooltip/index.d.ts.map +0 -1
- package/dist/GraphTooltip/index.js +0 -201
- package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.d.ts +0 -6
- package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.js +0 -59
- package/dist/ProfileIcicleGraph/IcicleGraph/IcicleGraphNodes.d.ts +0 -47
- package/dist/ProfileIcicleGraph/IcicleGraph/IcicleGraphNodes.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraph/IcicleGraphNodes.js +0 -93
- package/dist/ProfileIcicleGraph/IcicleGraph/index.d.ts +0 -14
- package/dist/ProfileIcicleGraph/IcicleGraph/index.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraph/index.js +0 -48
- package/dist/ProfileIcicleGraph/IcicleGraph/useColoredGraph.d.ts +0 -15
- package/dist/ProfileIcicleGraph/IcicleGraph/useColoredGraph.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraph/useColoredGraph.js +0 -57
- package/dist/ProfileIcicleGraph/IcicleGraph/useNodeColor.d.ts +0 -8
- package/dist/ProfileIcicleGraph/IcicleGraph/useNodeColor.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraph/useNodeColor.js +0 -32
- package/dist/ProfileIcicleGraph/IcicleGraph/utils.d.ts +0 -7
- package/dist/ProfileIcicleGraph/IcicleGraph/utils.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraph/utils.js +0 -66
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.d.ts +0 -9
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.js +0 -45
- package/dist/ProfileView/hooks/useGraphviz.d.ts +0 -12
- package/dist/ProfileView/hooks/useGraphviz.d.ts.map +0 -1
- package/dist/ProfileView/hooks/useGraphviz.js +0 -42
- package/src/Callgraph/index.tsx +0 -177
- package/src/Callgraph/mockData/index.ts +0 -605
- package/src/Callgraph/utils.ts +0 -141
- package/src/GraphTooltip/ExpandOnHoverValue.tsx +0 -30
- package/src/GraphTooltip/index.tsx +0 -509
- package/src/ProfileIcicleGraph/IcicleGraph/ColorStackLegend.tsx +0 -96
- package/src/ProfileIcicleGraph/IcicleGraph/IcicleGraphNodes.tsx +0 -266
- package/src/ProfileIcicleGraph/IcicleGraph/index.tsx +0 -123
- package/src/ProfileIcicleGraph/IcicleGraph/useColoredGraph.ts +0 -117
- package/src/ProfileIcicleGraph/IcicleGraph/useNodeColor.ts +0 -54
- package/src/ProfileIcicleGraph/IcicleGraph/utils.ts +0 -102
- package/src/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.tsx +0 -130
- package/src/ProfileView/hooks/useGraphviz.ts +0 -69
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.17.4](https://github.com/parca-dev/parca/compare/@parca/profile@0.17.3...@parca/profile@0.17.4) (2025-06-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.17.3](https://github.com/parca-dev/parca/compare/@parca/profile@0.17.2...@parca/profile@0.17.3) (2025-05-30)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.17.2](https://github.com/parca-dev/parca/compare/@parca/profile@0.17.1...@parca/profile@0.17.2) (2025-05-30)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -8,10 +8,9 @@ interface GraphTooltipArrowContentProps {
|
|
|
8
8
|
total: bigint;
|
|
9
9
|
totalUnfiltered: bigint;
|
|
10
10
|
row: number | null;
|
|
11
|
-
level: number;
|
|
12
11
|
isFixed: boolean;
|
|
13
12
|
compareAbsolute: boolean;
|
|
14
13
|
}
|
|
15
|
-
declare const GraphTooltipArrowContent: ({ table, profileType, unit, total, totalUnfiltered, row,
|
|
14
|
+
declare const GraphTooltipArrowContent: ({ table, profileType, unit, total, totalUnfiltered, row, isFixed, compareAbsolute, }: GraphTooltipArrowContentProps) => React.JSX.Element;
|
|
16
15
|
export default GraphTooltipArrowContent;
|
|
17
16
|
//# 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;AAGnC,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,
|
|
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;AAGnC,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,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAMD,QAAA,MAAM,wBAAwB,yFAS3B,6BAA6B,KAAG,KAAK,CAAC,GAAG,CAAC,OA+E5C,CAAC;AAuFF,eAAe,wBAAwB,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { useGraphTooltipMetaInfo } from './useGraphTooltipMetaInfo';
|
|
|
9
9
|
const NoData = () => {
|
|
10
10
|
return _jsx("span", { className: "rounded bg-gray-200 px-2 dark:bg-gray-800", children: "Not available" });
|
|
11
11
|
};
|
|
12
|
-
const GraphTooltipArrowContent = ({ table, profileType, unit, total, totalUnfiltered, row,
|
|
12
|
+
const GraphTooltipArrowContent = ({ table, profileType, unit, total, totalUnfiltered, row, isFixed, compareAbsolute, }) => {
|
|
13
13
|
const graphTooltipData = useGraphTooltip({
|
|
14
14
|
table,
|
|
15
15
|
profileType,
|
|
@@ -17,7 +17,6 @@ const GraphTooltipArrowContent = ({ table, profileType, unit, total, totalUnfilt
|
|
|
17
17
|
total,
|
|
18
18
|
totalUnfiltered,
|
|
19
19
|
row,
|
|
20
|
-
level,
|
|
21
20
|
compareAbsolute,
|
|
22
21
|
});
|
|
23
22
|
if (graphTooltipData === null) {
|
|
@@ -5,11 +5,10 @@ interface Props {
|
|
|
5
5
|
total: bigint;
|
|
6
6
|
totalUnfiltered: bigint;
|
|
7
7
|
row: number | null;
|
|
8
|
-
level: number;
|
|
9
8
|
profileType?: ProfileType;
|
|
10
9
|
unit?: string;
|
|
11
10
|
compareAbsolute: boolean;
|
|
12
11
|
}
|
|
13
|
-
export declare const DockedGraphTooltip: ({ table, total, totalUnfiltered, row,
|
|
12
|
+
export declare const DockedGraphTooltip: ({ table, total, totalUnfiltered, row, profileType, unit, compareAbsolute, }: Props) => JSX.Element;
|
|
14
13
|
export {};
|
|
15
14
|
//# 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,
|
|
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,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;CAC1B;AAuBD,eAAO,MAAM,kBAAkB,gFAQ5B,KAAK,KAAG,GAAG,CAAC,OAuGd,CAAC"}
|
|
@@ -25,7 +25,7 @@ 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,
|
|
28
|
+
export const DockedGraphTooltip = ({ table, total, totalUnfiltered, row, profileType, unit, compareAbsolute, }) => {
|
|
29
29
|
let { width } = useWindowSize();
|
|
30
30
|
const { profileExplorer } = useParcaContext();
|
|
31
31
|
const { PaddingX } = profileExplorer ?? { PaddingX: 0 };
|
|
@@ -37,7 +37,6 @@ export const DockedGraphTooltip = ({ table, total, totalUnfiltered, row, level,
|
|
|
37
37
|
total,
|
|
38
38
|
totalUnfiltered,
|
|
39
39
|
row,
|
|
40
|
-
level,
|
|
41
40
|
compareAbsolute,
|
|
42
41
|
});
|
|
43
42
|
const { labelPairs, functionFilename, file, locationAddress, mappingFile, mappingBuildID, inlined, } = useGraphTooltipMetaInfo({ table, row: row ?? 0 });
|
|
@@ -8,7 +8,6 @@ interface Props {
|
|
|
8
8
|
totalUnfiltered: bigint;
|
|
9
9
|
compareAbsolute: boolean;
|
|
10
10
|
row: number | null;
|
|
11
|
-
level: number;
|
|
12
11
|
}
|
|
13
12
|
interface GraphTooltipData {
|
|
14
13
|
name: string;
|
|
@@ -19,6 +18,6 @@ interface GraphTooltipData {
|
|
|
19
18
|
diff: bigint;
|
|
20
19
|
row: number;
|
|
21
20
|
}
|
|
22
|
-
export declare const useGraphTooltip: ({ table, profileType, unit, compareAbsolute, total, totalUnfiltered, row,
|
|
21
|
+
export declare const useGraphTooltip: ({ table, profileType, unit, compareAbsolute, total, totalUnfiltered, row, }: Props) => GraphTooltipData | null;
|
|
23
22
|
export {};
|
|
24
23
|
//# 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;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;
|
|
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;CACpB;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,gFAQzB,KAAK,KAAG,gBAAgB,GAAG,IAyC7B,CAAC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { divide, valueFormatter } from '@parca/utilities';
|
|
14
14
|
import { FIELD_CUMULATIVE, FIELD_DIFF, FIELD_FLAT, FIELD_LOCATION_ADDRESS, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
|
|
15
15
|
import { getTextForCumulative, nodeLabel } from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
|
|
16
|
-
export const useGraphTooltip = ({ table, profileType, unit, compareAbsolute, total, totalUnfiltered, row,
|
|
16
|
+
export const useGraphTooltip = ({ table, profileType, unit, compareAbsolute, total, totalUnfiltered, row, }) => {
|
|
17
17
|
if (row === null || profileType === undefined) {
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
@@ -35,7 +35,7 @@ export const useGraphTooltip = ({ table, profileType, unit, compareAbsolute, tot
|
|
|
35
35
|
const diffValueText = diffSign + valueFormatter(diff, unit, 1);
|
|
36
36
|
const diffPercentageText = diffSign + (diffRatio * 100).toFixed(2) + '%';
|
|
37
37
|
diffText = compareAbsolute ? `${diffValueText} (${diffPercentageText})` : diffPercentageText;
|
|
38
|
-
const name = nodeLabel(table, row,
|
|
38
|
+
const name = nodeLabel(table, row, false);
|
|
39
39
|
return {
|
|
40
40
|
name,
|
|
41
41
|
locationAddress,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Table } from 'apache-arrow';
|
|
2
2
|
import { ProfileType } from '@parca/parser';
|
|
3
|
-
import { CurrentPathFrame } from './utils';
|
|
4
3
|
interface ContextMenuProps {
|
|
5
4
|
menuId: string;
|
|
6
5
|
table: Table<any>;
|
|
@@ -9,14 +8,11 @@ interface ContextMenuProps {
|
|
|
9
8
|
total: bigint;
|
|
10
9
|
totalUnfiltered: bigint;
|
|
11
10
|
row: number;
|
|
12
|
-
level: number;
|
|
13
11
|
compareAbsolute: boolean;
|
|
14
|
-
|
|
15
|
-
curPath: CurrentPathFrame[];
|
|
16
|
-
setCurPath: (path: CurrentPathFrame[]) => void;
|
|
12
|
+
resetPath: () => void;
|
|
17
13
|
hideMenu: () => void;
|
|
18
14
|
hideBinary: (binaryToRemove: string) => void;
|
|
19
15
|
}
|
|
20
|
-
declare const ContextMenu: ({ menuId, table, total, totalUnfiltered, row,
|
|
16
|
+
declare const ContextMenu: ({ menuId, table, total, totalUnfiltered, row, compareAbsolute, hideMenu, profileType, unit, hideBinary, resetPath, }: ContextMenuProps) => JSX.Element;
|
|
21
17
|
export default ContextMenu;
|
|
22
18
|
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAMnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAMnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAO1C,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,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,CAAC;IACZ,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,QAAA,MAAM,WAAW,yHAYd,gBAAgB,KAAG,GAAG,CAAC,OAyLzB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -20,7 +20,7 @@ import { getLastItem } from '@parca/utilities';
|
|
|
20
20
|
import { useGraphTooltip } from '../../GraphTooltipArrow/useGraphTooltip';
|
|
21
21
|
import { useGraphTooltipMetaInfo } from '../../GraphTooltipArrow/useGraphTooltipMetaInfo';
|
|
22
22
|
import { hexifyAddress, truncateString } from '../../utils';
|
|
23
|
-
const ContextMenu = ({ menuId, table, total, totalUnfiltered, row,
|
|
23
|
+
const ContextMenu = ({ menuId, table, total, totalUnfiltered, row, compareAbsolute, hideMenu, profileType, unit, hideBinary, resetPath, }) => {
|
|
24
24
|
const { isDarkMode } = useParcaContext();
|
|
25
25
|
const { enableSourcesView, checkDebuginfoStatusHandler } = useParcaContext();
|
|
26
26
|
const [isGraphTooltipDocked, setIsDocked] = useUserPreference(USER_PREFERENCES.GRAPH_METAINFO_DOCKED.key);
|
|
@@ -31,7 +31,6 @@ const ContextMenu = ({ menuId, table, total, totalUnfiltered, row, level, compar
|
|
|
31
31
|
total,
|
|
32
32
|
totalUnfiltered,
|
|
33
33
|
row,
|
|
34
|
-
level,
|
|
35
34
|
compareAbsolute,
|
|
36
35
|
});
|
|
37
36
|
const { functionFilename, functionSystemName, file, openFile, isSourceAvailable, locationAddress, mappingFile, mappingBuildID, inlined, } = useGraphTooltipMetaInfo({ table, row });
|
|
@@ -46,7 +45,7 @@ const ContextMenu = ({ menuId, table, total, totalUnfiltered, row, level, compar
|
|
|
46
45
|
const isMappingBuildIDAvailable = mappingBuildID !== null && mappingBuildID !== '';
|
|
47
46
|
const handleViewSourceFile = () => openFile();
|
|
48
47
|
const handleResetView = () => {
|
|
49
|
-
|
|
48
|
+
resetPath();
|
|
50
49
|
return hideMenu();
|
|
51
50
|
};
|
|
52
51
|
const handleDockTooltip = () => {
|
|
@@ -82,9 +81,9 @@ const ContextMenu = ({ menuId, table, total, totalUnfiltered, row, level, compar
|
|
|
82
81
|
{ id: 'Build Id', value: buildIdText },
|
|
83
82
|
];
|
|
84
83
|
const nonEmptyValuesToCopy = valuesToCopy.filter(({ value }) => value !== '');
|
|
85
|
-
return (_jsxs(Menu, { id: menuId,
|
|
84
|
+
return (_jsxs(Menu, { id: menuId, theme: isDarkMode ? 'dark' : '', children: [_jsxs(Item, { id: "view-source-file", onClick: handleViewSourceFile, disabled: enableSourcesView === false || !isSourceAvailable, children: [_jsx("div", { "data-tooltip-id": "view-source-file-help", "data-tooltip-content": "There is no source code uploaded for this build", children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "wpf:view-file" }), _jsx("div", { children: "View source file" })] }) }), !isSourceAvailable ? _jsx(Tooltip, { id: "view-source-file-help" }) : null] }), _jsx(Item, { id: "show-in-table", onClick: () => {
|
|
86
85
|
setSearchString(functionName);
|
|
87
86
|
setDashboardItems([...dashboardItems, 'table']);
|
|
88
|
-
}, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "ph:table" }), _jsx("div", { children: "Show in table" })] }) }), _jsx(Item, { id: "reset-view", onClick: handleResetView,
|
|
87
|
+
}, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "ph:table" }), _jsx("div", { children: "Show in table" })] }) }), _jsx(Item, { id: "reset-view", onClick: handleResetView, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "system-uicons:reset" }), _jsx("div", { children: "Reset graph" })] }) }), _jsxs(Item, { id: "hide-binary", onClick: () => hideBinary(getLastItem(mappingFile)), disabled: mappingFile === null || mappingFile === '', children: [_jsx("div", { "data-tooltip-id": "hide-binary-help", "data-tooltip-content": "Hide all frames for this binary", children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "bx:bxs-hide" }), _jsxs("div", { children: ["Hide binary ", mappingFile !== null && `(${getLastItem(mappingFile)})`] })] }) }), _jsx(Tooltip, { place: "left", id: "hide-binary-help" })] }), _jsx(Submenu, { label: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "ph:copy" }), _jsx("div", { children: "Copy" })] }), children: _jsx("div", { className: "max-h-[300px] overflow-scroll", children: nonEmptyValuesToCopy.map(({ id, value }) => (_jsx(Item, { id: id, onClick: () => handleCopyItem(value), className: "dark:bg-gray-800", children: _jsxs("div", { className: "flex flex-col dark:text-gray-300 hover:dark:text-gray-100", children: [_jsx("div", { className: "text-sm", children: id }), _jsx("div", { className: "text-xs", children: truncateString(value, 30) })] }) }, id))) }) }), checkDebuginfoStatusHandler !== undefined ? (_jsx(Item, { id: "check-debuginfo-status", onClick: () => checkDebuginfoStatusHandler(mappingBuildID), disabled: !isMappingBuildIDAvailable, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "bx:bx-info-circle" }), _jsx("div", { className: "relative pr-4", children: "Check debuginfo status" })] }) })) : null, _jsx(Separator, {}), _jsx(Item, { id: "dock-tooltip", onClick: handleDockTooltip, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "bx:dock-bottom" }), isGraphTooltipDocked ? 'Undock tooltip' : 'Dock tooltip'] }) })] }));
|
|
89
88
|
};
|
|
90
89
|
export default ContextMenu;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Table } from 'apache-arrow';
|
|
2
|
+
import { ProfileType } from '@parca/parser';
|
|
3
|
+
interface ContextMenuWrapperProps {
|
|
4
|
+
menuId: string;
|
|
5
|
+
table: Table<any>;
|
|
6
|
+
total: bigint;
|
|
7
|
+
totalUnfiltered: bigint;
|
|
8
|
+
profileType?: ProfileType;
|
|
9
|
+
compareAbsolute: boolean;
|
|
10
|
+
resetPath: () => void;
|
|
11
|
+
hideMenu: () => void;
|
|
12
|
+
hideBinary: (binaryToRemove: string) => void;
|
|
13
|
+
unit?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ContextMenuWrapperRef {
|
|
16
|
+
setRow: (row: number) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const ContextMenuWrapper: import("react").ForwardRefExoticComponent<ContextMenuWrapperProps & import("react").RefAttributes<ContextMenuWrapperRef>>;
|
|
19
|
+
export default ContextMenuWrapper;
|
|
20
|
+
//# sourceMappingURL=ContextMenuWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenuWrapper.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAI1C,UAAU,uBAAuB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAED,QAAA,MAAM,kBAAkB,2HAUvB,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 2022 The Parca Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,6 +11,14 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
import { forwardRef, useImperativeHandle, useState } from 'react';
|
|
15
|
+
import ContextMenu from './ContextMenu';
|
|
16
|
+
const ContextMenuWrapper = forwardRef((props, ref) => {
|
|
17
|
+
const [row, setRow] = useState(0);
|
|
18
|
+
useImperativeHandle(ref, () => ({
|
|
19
|
+
setRow,
|
|
20
|
+
}));
|
|
21
|
+
return _jsx(ContextMenu, { ...props, row: row });
|
|
22
|
+
});
|
|
23
|
+
ContextMenuWrapper.displayName = 'ContextMenuWrapper';
|
|
24
|
+
export default ContextMenuWrapper;
|
|
@@ -1,71 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Table } from 'apache-arrow';
|
|
3
3
|
import 'react-contexify/dist/ReactContexify.css';
|
|
4
|
-
import {
|
|
5
|
-
import { CurrentPathFrame } from './utils';
|
|
4
|
+
import { ProfileSource } from '../../ProfileSource';
|
|
6
5
|
export declare const RowHeight = 26;
|
|
7
|
-
interface IcicleGraphNodesProps {
|
|
8
|
-
table: Table<any>;
|
|
9
|
-
row: number;
|
|
10
|
-
colors: colorByColors;
|
|
11
|
-
colorBy: string;
|
|
12
|
-
childRows: number[];
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
total: bigint;
|
|
16
|
-
totalWidth: number;
|
|
17
|
-
level: number;
|
|
18
|
-
curPath: CurrentPathFrame[];
|
|
19
|
-
setCurPath: (path: CurrentPathFrame[]) => void;
|
|
20
|
-
setHoveringRow: (row: number | null) => void;
|
|
21
|
-
setHoveringLevel: (level: number | null) => void;
|
|
22
|
-
path: CurrentPathFrame[];
|
|
23
|
-
xScale: (value: bigint) => number;
|
|
24
|
-
searchString?: string;
|
|
25
|
-
sortBy: string;
|
|
26
|
-
darkMode: boolean;
|
|
27
|
-
compareMode: boolean;
|
|
28
|
-
profileType?: ProfileType;
|
|
29
|
-
isContextMenuOpen: boolean;
|
|
30
|
-
hoveringName: string | null;
|
|
31
|
-
setHoveringName: (name: string | null) => void;
|
|
32
|
-
hoveringRow: number | null;
|
|
33
|
-
colorForSimilarNodes: string;
|
|
34
|
-
highlightSimilarStacksPreference: boolean;
|
|
35
|
-
}
|
|
36
|
-
export declare const IcicleGraphNodes: React.NamedExoticComponent<IcicleGraphNodesProps>;
|
|
37
6
|
export interface colorByColors {
|
|
38
7
|
[key: string]: string;
|
|
39
8
|
}
|
|
40
9
|
export interface IcicleNodeProps {
|
|
41
|
-
x: number;
|
|
42
|
-
y: number;
|
|
43
10
|
height: number;
|
|
44
11
|
totalWidth: number;
|
|
45
|
-
curPath: CurrentPathFrame[];
|
|
46
|
-
level: number;
|
|
47
12
|
table: Table<any>;
|
|
48
13
|
row: number;
|
|
49
14
|
colors: colorByColors;
|
|
50
15
|
colorBy: string;
|
|
51
|
-
path: CurrentPathFrame[];
|
|
52
|
-
total: bigint;
|
|
53
|
-
setCurPath: (path: CurrentPathFrame[]) => void;
|
|
54
|
-
setHoveringRow: (row: number | null) => void;
|
|
55
|
-
setHoveringLevel: (level: number | null) => void;
|
|
56
|
-
xScale: (value: bigint) => number;
|
|
57
|
-
isRoot?: boolean;
|
|
58
16
|
searchString?: string;
|
|
59
|
-
sortBy: string;
|
|
60
17
|
darkMode: boolean;
|
|
61
18
|
compareMode: boolean;
|
|
62
|
-
|
|
63
|
-
isContextMenuOpen: boolean;
|
|
64
|
-
hoveringName: string | null;
|
|
65
|
-
setHoveringName: (name: string | null) => void;
|
|
66
|
-
hoveringRow: number | null;
|
|
19
|
+
onContextMenu: (e: React.MouseEvent, row: number) => void;
|
|
67
20
|
colorForSimilarNodes: string;
|
|
68
|
-
|
|
21
|
+
selectedRow: number;
|
|
22
|
+
onClick: () => void;
|
|
23
|
+
isIcicleChart: boolean;
|
|
24
|
+
profileSource: ProfileSource;
|
|
25
|
+
hoveringRow?: number;
|
|
26
|
+
setHoveringRow: (row: number | undefined) => void;
|
|
69
27
|
}
|
|
70
28
|
export declare const icicleRectStyles: {
|
|
71
29
|
cursor: string;
|
|
@@ -77,5 +35,4 @@ export declare const fadedIcicleRectStyles: {
|
|
|
77
35
|
opacity: string;
|
|
78
36
|
};
|
|
79
37
|
export declare const IcicleNode: React.NamedExoticComponent<IcicleNodeProps>;
|
|
80
|
-
export {};
|
|
81
38
|
//# sourceMappingURL=IcicleGraphNodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IcicleGraphNodes.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.tsx"],"names":[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"IcicleGraphNodes.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAErC,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAMnC,OAAO,yCAAyC,CAAC;AAIjD,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAgBlD,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAG7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AACF,eAAO,MAAM,qBAAqB;;;;CAIjC,CAAC;AAEF,eAAO,MAAM,UAAU,6CA4KrB,CAAC"}
|
|
@@ -14,32 +14,13 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
14
14
|
import React, { useMemo } from 'react';
|
|
15
15
|
import cx from 'classnames';
|
|
16
16
|
import { selectBinaries, useAppSelector } from '@parca/store';
|
|
17
|
-
import { isSearchMatch
|
|
17
|
+
import { isSearchMatch } from '@parca/utilities';
|
|
18
18
|
import 'react-contexify/dist/ReactContexify.css';
|
|
19
19
|
import TextWithEllipsis from './TextWithEllipsis';
|
|
20
|
-
import {
|
|
20
|
+
import { FIELD_CUMULATIVE, FIELD_DEPTH, FIELD_DIFF, FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_NAME, FIELD_MAPPING_FILE, FIELD_TIMESTAMP, FIELD_VALUE_OFFSET, } from './index';
|
|
21
21
|
import useNodeColor from './useNodeColor';
|
|
22
|
-
import { arrowToString,
|
|
22
|
+
import { arrowToString, boundsFromProfileSource, nodeLabel } from './utils';
|
|
23
23
|
export const RowHeight = 26;
|
|
24
|
-
export const IcicleGraphNodes = React.memo(function IcicleGraphNodesNoMemo({ table, childRows, colors, colorBy, x, y, xScale, total, totalWidth, level, path, setCurPath, setHoveringRow, setHoveringLevel, curPath, sortBy, searchString, darkMode, compareMode, profileType, isContextMenuOpen, hoveringName, setHoveringName, hoveringRow, colorForSimilarNodes, highlightSimilarStacksPreference, }) {
|
|
25
|
-
const cumulatives = table.getChild(FIELD_CUMULATIVE);
|
|
26
|
-
if (childRows === undefined || childRows.length === 0) {
|
|
27
|
-
return _jsx(_Fragment, {});
|
|
28
|
-
}
|
|
29
|
-
childRows =
|
|
30
|
-
curPath.length === 0
|
|
31
|
-
? childRows
|
|
32
|
-
: childRows.filter(c => isCurrentPathFrameMatch(table, c, level, curPath[0]));
|
|
33
|
-
let childrenCumulative = BigInt(0);
|
|
34
|
-
const childrenElements = [];
|
|
35
|
-
childRows.forEach((child, i) => {
|
|
36
|
-
const xStart = Math.floor(xScale(BigInt(childrenCumulative)));
|
|
37
|
-
const c = BigInt(cumulatives?.get(child));
|
|
38
|
-
childrenCumulative += c;
|
|
39
|
-
childrenElements.push(_jsx(IcicleNode, { table: table, row: child, colors: colors, colorBy: colorBy, x: xStart, y: 0, totalWidth: totalWidth, height: RowHeight, path: path, setCurPath: setCurPath, setHoveringRow: setHoveringRow, setHoveringLevel: setHoveringLevel, level: level, curPath: curPath, total: total, xScale: xScale, sortBy: sortBy, searchString: searchString, darkMode: darkMode, compareMode: compareMode, profileType: profileType, isContextMenuOpen: isContextMenuOpen, hoveringName: hoveringName, setHoveringName: setHoveringName, hoveringRow: hoveringRow, colorForSimilarNodes: colorForSimilarNodes, highlightSimilarStacksPreference: highlightSimilarStacksPreference }, `node-${level}-${i}`));
|
|
40
|
-
});
|
|
41
|
-
return _jsx("g", { transform: `translate(${x}, ${y})`, children: childrenElements });
|
|
42
|
-
});
|
|
43
24
|
export const icicleRectStyles = {
|
|
44
25
|
cursor: 'pointer',
|
|
45
26
|
transition: 'opacity .15s linear',
|
|
@@ -49,100 +30,28 @@ export const fadedIcicleRectStyles = {
|
|
|
49
30
|
transition: 'opacity .15s linear',
|
|
50
31
|
opacity: '0.5',
|
|
51
32
|
};
|
|
52
|
-
export const IcicleNode = React.memo(function IcicleNodeNoMemo({ table, row, colors, colorBy,
|
|
33
|
+
export const IcicleNode = React.memo(function IcicleNodeNoMemo({ table, row, colors, colorBy, height, totalWidth, searchString, darkMode, compareMode, colorForSimilarNodes, selectedRow, onClick, onContextMenu, hoveringRow, setHoveringRow, isIcicleChart, profileSource, }) {
|
|
53
34
|
// get the columns to read from
|
|
54
35
|
const mappingColumn = table.getChild(FIELD_MAPPING_FILE);
|
|
55
36
|
const functionNameColumn = table.getChild(FIELD_FUNCTION_NAME);
|
|
56
37
|
const cumulativeColumn = table.getChild(FIELD_CUMULATIVE);
|
|
38
|
+
const depthColumn = table.getChild(FIELD_DEPTH);
|
|
57
39
|
const diffColumn = table.getChild(FIELD_DIFF);
|
|
58
40
|
const filenameColumn = table.getChild(FIELD_FUNCTION_FILE_NAME);
|
|
41
|
+
const valueOffsetColumn = table.getChild(FIELD_VALUE_OFFSET);
|
|
42
|
+
const tsColumn = table.getChild(FIELD_TIMESTAMP);
|
|
59
43
|
// get the actual values from the columns
|
|
60
44
|
const mappingFile = arrowToString(mappingColumn?.get(row));
|
|
61
45
|
const functionName = arrowToString(functionNameColumn?.get(row));
|
|
62
46
|
const cumulative = cumulativeColumn?.get(row) !== null ? BigInt(cumulativeColumn?.get(row)) : 0n;
|
|
63
47
|
const diff = diffColumn?.get(row) !== null ? BigInt(diffColumn?.get(row)) : null;
|
|
64
|
-
const childRows = Array.from(table.getChild(FIELD_CHILDREN)?.get(row) ?? []);
|
|
65
48
|
const filename = arrowToString(filenameColumn?.get(row));
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
attr = filename;
|
|
70
|
-
}
|
|
71
|
-
else if (colorBy === 'binary') {
|
|
72
|
-
attr = mappingFile;
|
|
73
|
-
}
|
|
74
|
-
return attr ?? null; // Provide a default value of null if attr is undefined
|
|
75
|
-
}, [colorBy, filename, mappingFile]);
|
|
49
|
+
const depth = depthColumn?.get(row) ?? 0;
|
|
50
|
+
const valueOffset = valueOffsetColumn?.get(row) !== null ? BigInt(valueOffsetColumn?.get(row)) : 0n;
|
|
51
|
+
const colorAttribute = colorBy === 'filename' ? filename : colorBy === 'binary' ? mappingFile : null;
|
|
76
52
|
const colorsMap = colors;
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
if (functionName != null && functionName === hoveringName) {
|
|
82
|
-
return { functionName, row: hoveringRow };
|
|
83
|
-
}
|
|
84
|
-
return null; // Nothing to highlight
|
|
85
|
-
}, [functionName, hoveringName, hoveringRow, highlightSimilarStacksPreference]);
|
|
86
|
-
const shouldBeHighlightedIfSimilarStacks = useMemo(() => {
|
|
87
|
-
return highlightedNodes !== null && row !== highlightedNodes.row;
|
|
88
|
-
}, [row, highlightedNodes]);
|
|
89
|
-
// TODO: Maybe it's better to pass down the sorter function as prop instead of figuring this out here.
|
|
90
|
-
switch (sortBy) {
|
|
91
|
-
case FIELD_FUNCTION_NAME:
|
|
92
|
-
childRows.sort((a, b) => {
|
|
93
|
-
// TODO: Support fallthrough to comparing addresses or something
|
|
94
|
-
const afn = arrowToString(functionNameColumn?.get(a));
|
|
95
|
-
const bfn = arrowToString(functionNameColumn?.get(b));
|
|
96
|
-
if (afn !== null && bfn !== null) {
|
|
97
|
-
return afn.localeCompare(bfn);
|
|
98
|
-
}
|
|
99
|
-
if (afn === null && bfn !== null) {
|
|
100
|
-
return -1;
|
|
101
|
-
}
|
|
102
|
-
if (afn !== null && bfn === null) {
|
|
103
|
-
return 1;
|
|
104
|
-
}
|
|
105
|
-
// both are null
|
|
106
|
-
return 0;
|
|
107
|
-
});
|
|
108
|
-
break;
|
|
109
|
-
case FIELD_CUMULATIVE:
|
|
110
|
-
childRows.sort((a, b) => {
|
|
111
|
-
const aCumulative = cumulativeColumn?.get(a);
|
|
112
|
-
const bCumulative = cumulativeColumn?.get(b);
|
|
113
|
-
return Number(bCumulative - aCumulative);
|
|
114
|
-
});
|
|
115
|
-
break;
|
|
116
|
-
case FIELD_DIFF:
|
|
117
|
-
childRows.sort((a, b) => {
|
|
118
|
-
let aRatio = null;
|
|
119
|
-
const aDiff = diffColumn?.get(a) !== null ? BigInt(diffColumn?.get(a)) : null;
|
|
120
|
-
if (aDiff !== null) {
|
|
121
|
-
const cumulative = cumulativeColumn?.get(a) !== null ? BigInt(cumulativeColumn?.get(a)) : 0n;
|
|
122
|
-
const prev = cumulative - aDiff;
|
|
123
|
-
aRatio = Number(aDiff) / Number(prev);
|
|
124
|
-
}
|
|
125
|
-
let bRatio = null;
|
|
126
|
-
const bDiff = diffColumn?.get(b) !== null ? BigInt(diffColumn?.get(b)) : null;
|
|
127
|
-
if (bDiff !== null) {
|
|
128
|
-
const cumulative = cumulativeColumn?.get(b) !== null ? BigInt(cumulativeColumn?.get(b)) : 0n;
|
|
129
|
-
const prev = cumulative - bDiff;
|
|
130
|
-
bRatio = Number(bDiff) / Number(prev);
|
|
131
|
-
}
|
|
132
|
-
if (aRatio !== null && bRatio !== null) {
|
|
133
|
-
return bRatio - aRatio;
|
|
134
|
-
}
|
|
135
|
-
if (aRatio === null && bRatio !== null) {
|
|
136
|
-
return -1;
|
|
137
|
-
}
|
|
138
|
-
if (aRatio !== null && bRatio === null) {
|
|
139
|
-
return 1;
|
|
140
|
-
}
|
|
141
|
-
// both are null
|
|
142
|
-
return 0;
|
|
143
|
-
});
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
53
|
+
const hoveringName = hoveringRow !== undefined ? arrowToString(functionNameColumn?.get(hoveringRow)) : '';
|
|
54
|
+
const shouldBeHighlighted = functionName != null && hoveringName != null && functionName === hoveringName;
|
|
146
55
|
const binaries = useAppSelector(selectBinaries);
|
|
147
56
|
const colorResult = useNodeColor({
|
|
148
57
|
isDarkMode: darkMode,
|
|
@@ -153,50 +62,64 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({ table, row, col
|
|
|
153
62
|
colorAttribute,
|
|
154
63
|
});
|
|
155
64
|
const name = useMemo(() => {
|
|
156
|
-
return
|
|
157
|
-
}, [table, row,
|
|
158
|
-
const currentPathFrame = getCurrentPathFrameData(table, row, level);
|
|
159
|
-
const nextPath = path.concat([currentPathFrame]);
|
|
160
|
-
const isFaded = curPath.length > 0 && !isCurrentPathFrameMatch(table, row, level, curPath[curPath.length - 1]);
|
|
161
|
-
const styles = isFaded ? fadedIcicleRectStyles : icicleRectStyles;
|
|
162
|
-
const nextLevel = level + 1;
|
|
163
|
-
const nextCurPath = curPath.length === 0 ? [] : curPath.slice(1);
|
|
164
|
-
const newXScale = nextCurPath.length === 0 && curPath.length === 1
|
|
165
|
-
? scaleLinear([0n, BigInt(cumulative)], [0, totalWidth])
|
|
166
|
-
: xScale;
|
|
167
|
-
const width = nextCurPath.length > 0 || (nextCurPath.length === 0 && curPath.length === 1)
|
|
168
|
-
? totalWidth
|
|
169
|
-
: xScale(BigInt(cumulative));
|
|
65
|
+
return row === 0 ? 'root' : nodeLabel(table, row, binaries.length > 1);
|
|
66
|
+
}, [table, row, binaries]);
|
|
170
67
|
const { isHighlightEnabled = false, isHighlighted = false } = useMemo(() => {
|
|
171
68
|
if (searchString === undefined || searchString === '') {
|
|
172
69
|
return { isHighlightEnabled: false };
|
|
173
70
|
}
|
|
174
71
|
return { isHighlightEnabled: true, isHighlighted: isSearchMatch(searchString, name) };
|
|
175
72
|
}, [searchString, name]);
|
|
73
|
+
const selectionOffset = valueOffsetColumn?.get(selectedRow) !== null ? BigInt(valueOffsetColumn?.get(selectedRow)) : 0n;
|
|
74
|
+
const selectionCumulative = cumulativeColumn?.get(selectedRow) !== null ? BigInt(cumulativeColumn?.get(selectedRow)) : 0n;
|
|
75
|
+
if (valueOffset + cumulative <= selectionOffset ||
|
|
76
|
+
valueOffset >= selectionOffset + selectionCumulative) {
|
|
77
|
+
// If the end of the node is before the selection offset or the start of the node is after the selection offset + totalWidth, we don't render it.
|
|
78
|
+
return _jsx(_Fragment, {});
|
|
79
|
+
}
|
|
80
|
+
if (row === 0 && isIcicleChart) {
|
|
81
|
+
// The root node is not rendered in the icicle chart, so we return null.
|
|
82
|
+
return _jsx(_Fragment, {});
|
|
83
|
+
}
|
|
84
|
+
// Cumulative can be larger than total when a selection is made. All parents of the selection are likely larger, but we want to only show them as 100% in the graph.
|
|
85
|
+
const tsBounds = boundsFromProfileSource(profileSource);
|
|
86
|
+
const total = cumulativeColumn?.get(selectedRow);
|
|
87
|
+
const totalRatio = cumulative > total ? 1 : Number(cumulative) / Number(total);
|
|
88
|
+
const width = isIcicleChart
|
|
89
|
+
? (Number(cumulative) / (Number(tsBounds[1]) - Number(tsBounds[0]))) * totalWidth
|
|
90
|
+
: totalRatio * totalWidth;
|
|
176
91
|
if (width <= 1) {
|
|
177
|
-
return _jsx(_Fragment, {
|
|
92
|
+
return _jsx(_Fragment, {});
|
|
178
93
|
}
|
|
94
|
+
const selectedDepth = depthColumn?.get(selectedRow);
|
|
95
|
+
const styles = selectedDepth !== undefined && selectedDepth > depth ? fadedIcicleRectStyles : icicleRectStyles;
|
|
179
96
|
const onMouseEnter = () => {
|
|
180
|
-
if (isContextMenuOpen)
|
|
181
|
-
return;
|
|
182
97
|
setHoveringRow(row);
|
|
183
|
-
|
|
184
|
-
|
|
98
|
+
window.dispatchEvent(new CustomEvent('icicle-tooltip-update', {
|
|
99
|
+
detail: { row },
|
|
100
|
+
}));
|
|
185
101
|
};
|
|
186
102
|
const onMouseLeave = () => {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
103
|
+
setHoveringRow(undefined);
|
|
104
|
+
window.dispatchEvent(new CustomEvent('icicle-tooltip-update', {
|
|
105
|
+
detail: { row: null },
|
|
106
|
+
}));
|
|
107
|
+
};
|
|
108
|
+
const handleContextMenu = (e) => {
|
|
109
|
+
onContextMenu(e, row);
|
|
192
110
|
};
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
111
|
+
const ts = tsColumn !== null ? Number(tsColumn.get(row)) : 0;
|
|
112
|
+
const x = isIcicleChart && tsColumn !== null
|
|
113
|
+
? ((ts - Number(tsBounds[0])) / (Number(tsBounds[1]) - Number(tsBounds[0]))) * totalWidth
|
|
114
|
+
: selectedDepth > depth
|
|
115
|
+
? 0
|
|
116
|
+
: ((Number(valueOffset) - Number(selectionOffset)) / Number(total)) * totalWidth;
|
|
117
|
+
const y = isIcicleChart ? (depth - 1) * height : depth * height;
|
|
118
|
+
return (_jsx(_Fragment, { children: _jsxs("g", { transform: `translate(${x + 1}, ${y + 1})`, style: styles, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: onClick, onContextMenu: handleContextMenu, children: [_jsx("rect", { x: 0, y: 0, width: width, height: height, style: {
|
|
119
|
+
fill: colorResult,
|
|
120
|
+
}, className: cx(shouldBeHighlighted
|
|
121
|
+
? `${colorForSimilarNodes} stroke-[3] [stroke-dasharray:6,4] [stroke-linecap:round] [stroke-linejoin:round] h-6`
|
|
122
|
+
: 'stroke-white dark:stroke-gray-700', {
|
|
123
|
+
'opacity-50': isHighlightEnabled && !isHighlighted,
|
|
124
|
+
}) }), width > 5 && (_jsx("svg", { width: width - 5, height: height, children: _jsx(TextWithEllipsis, { text: name, x: 5, y: 15, width: width - 10 }) }))] }) }));
|
|
202
125
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface MemoizedTooltipProps {
|
|
3
|
+
contextElement: Element | null;
|
|
4
|
+
dockedMetainfo: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const MemoizedTooltip: React.NamedExoticComponent<MemoizedTooltipProps>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=MemoizedTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoizedTooltip.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/MemoizedTooltip.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAOvD,UAAU,oBAAoB;IAC5B,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,eAAe,kDAoD1B,CAAC"}
|