@parca/profile 0.19.12 → 0.19.14
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.js +1 -1
- package/dist/GraphTooltipArrow/index.js +2 -2
- package/dist/MatchersInput/index.d.ts +3 -1
- package/dist/MatchersInput/index.d.ts.map +1 -1
- package/dist/MatchersInput/index.js +8 -4
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.js +12 -3
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.d.ts +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.js +9 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.d.ts +1 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.js +7 -3
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/MemoizedTooltip.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/MemoizedTooltip.js +17 -2
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts +2 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.js +23 -8
- package/dist/ProfileIcicleGraph/index.d.ts +3 -1
- package/dist/ProfileIcicleGraph/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/index.js +6 -4
- package/dist/ProfileSelector/QueryControls.d.ts.map +1 -1
- package/dist/ProfileSelector/QueryControls.js +1 -1
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +4 -2
- package/dist/ProfileView/components/DashboardItems/index.d.ts.map +1 -1
- package/dist/ProfileView/components/DashboardItems/index.js +1 -1
- package/dist/ProfileView/components/ShareButton/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ShareButton/index.js +1 -1
- package/dist/ProfileView/components/Toolbars/index.d.ts +0 -2
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +4 -5
- package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/index.js +18 -11
- package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
- package/dist/ProfileView/context/DashboardContext.js +5 -0
- package/dist/ProfileView/index.d.ts.map +1 -1
- package/dist/ProfileView/index.js +4 -3
- package/dist/Sandwich/components/CalleesSection.d.ts +1 -2
- package/dist/Sandwich/components/CalleesSection.d.ts.map +1 -1
- package/dist/Sandwich/components/CalleesSection.js +2 -6
- package/dist/Sandwich/components/CallersSection.d.ts +4 -2
- package/dist/Sandwich/components/CallersSection.d.ts.map +1 -1
- package/dist/Sandwich/components/CallersSection.js +45 -9
- package/dist/Sandwich/components/TableSection.js +1 -1
- package/dist/Sandwich/index.d.ts +0 -1
- package/dist/Sandwich/index.d.ts.map +1 -1
- package/dist/Sandwich/index.js +27 -79
- package/dist/SimpleMatchers/index.d.ts +2 -0
- package/dist/SimpleMatchers/index.d.ts.map +1 -1
- package/dist/SimpleMatchers/index.js +16 -6
- package/dist/Table/MoreDropdown.d.ts.map +1 -1
- package/dist/Table/MoreDropdown.js +1 -2
- package/dist/Table/TableContextMenu.d.ts +9 -0
- package/dist/Table/TableContextMenu.d.ts.map +1 -0
- package/dist/Table/TableContextMenu.js +38 -0
- package/dist/Table/TableContextMenuWrapper.d.ts +10 -0
- package/dist/Table/TableContextMenuWrapper.d.ts.map +1 -0
- package/dist/Table/TableContextMenuWrapper.js +30 -0
- package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
- package/dist/Table/hooks/useTableConfiguration.js +2 -20
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +65 -5
- package/dist/ViewMatchers/index.d.ts +2 -0
- package/dist/ViewMatchers/index.d.ts.map +1 -1
- package/dist/ViewMatchers/index.js +14 -4
- package/dist/contexts/MatchersInputLabelsContext.d.ts +3 -1
- package/dist/contexts/MatchersInputLabelsContext.d.ts.map +1 -1
- package/dist/contexts/MatchersInputLabelsContext.js +3 -3
- package/dist/contexts/SimpleMatchersLabelContext.d.ts +3 -1
- package/dist/contexts/SimpleMatchersLabelContext.d.ts.map +1 -1
- package/dist/contexts/SimpleMatchersLabelContext.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/GraphTooltipArrow/Content.tsx +3 -3
- package/src/GraphTooltipArrow/index.tsx +2 -2
- package/src/MatchersInput/index.tsx +17 -4
- package/src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx +19 -3
- package/src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenuWrapper.tsx +10 -2
- package/src/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.tsx +19 -2
- package/src/ProfileIcicleGraph/IcicleGraphArrow/MemoizedTooltip.tsx +20 -2
- package/src/ProfileIcicleGraph/IcicleGraphArrow/index.tsx +40 -6
- package/src/ProfileIcicleGraph/index.tsx +20 -2
- package/src/ProfileSelector/QueryControls.tsx +6 -0
- package/src/ProfileSelector/index.tsx +12 -2
- package/src/ProfileView/components/DashboardItems/index.tsx +0 -1
- package/src/ProfileView/components/ShareButton/index.tsx +9 -3
- package/src/ProfileView/components/Toolbars/index.tsx +7 -23
- package/src/ProfileView/components/ViewSelector/index.tsx +20 -11
- package/src/ProfileView/context/DashboardContext.tsx +6 -0
- package/src/ProfileView/index.tsx +12 -4
- package/src/Sandwich/components/CalleesSection.tsx +1 -7
- package/src/Sandwich/components/CallersSection.tsx +92 -35
- package/src/Sandwich/components/TableSection.tsx +2 -2
- package/src/Sandwich/index.tsx +20 -107
- package/src/SimpleMatchers/index.tsx +20 -4
- package/src/Table/MoreDropdown.tsx +1 -2
- package/src/Table/TableContextMenu.tsx +70 -0
- package/src/Table/TableContextMenuWrapper.tsx +48 -0
- package/src/Table/hooks/useTableConfiguration.tsx +2 -25
- package/src/Table/index.tsx +84 -5
- package/src/ViewMatchers/index.tsx +17 -3
- package/src/contexts/MatchersInputLabelsContext.tsx +10 -2
- package/src/contexts/SimpleMatchersLabelContext.tsx +5 -1
|
@@ -25,8 +25,6 @@ export interface VisualisationToolbarProps {
|
|
|
25
25
|
setGroupByLabels: (labels: string[]) => void;
|
|
26
26
|
showVisualizationSelector?: boolean;
|
|
27
27
|
sandwichFunctionName?: string;
|
|
28
|
-
setSandwichFunctionName: (sandwichFunctionName: string | undefined) => void;
|
|
29
|
-
resetSandwichFunctionName: () => void;
|
|
30
28
|
}
|
|
31
29
|
export interface TableToolbarProps {
|
|
32
30
|
profileType?: ProfileType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAIzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oDAAoD,CAAC;AACpF,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAUrD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6BAA6B,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAIzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oDAAoD,CAAC;AACpF,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAUrD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6BAA6B,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,+BAA+B;IAC9C,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAwB9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAiB1D,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,EAAE,CAAC,+BAA+B,CAmB1E,CAAC;AAMF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA+F9D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Icon } from '@iconify/react';
|
|
3
|
-
import { Button
|
|
3
|
+
import { Button } from '@parca/components';
|
|
4
4
|
import { useDashboard } from '../../context/DashboardContext';
|
|
5
5
|
import GroupByDropdown from '../ActionButtons/GroupByDropdown';
|
|
6
6
|
import FilterByFunctionButton from '../FilterByFunctionButton';
|
|
@@ -19,18 +19,17 @@ export const SandwichIcicleGraphToolbar = ({ resetSandwichFunctionName, sandwich
|
|
|
19
19
|
return (_jsx(_Fragment, { children: _jsx("div", { className: "flex w-full gap-2 items-end justify-between", children: _jsx(Button, { color: "neutral", onClick: () => resetSandwichFunctionName(), className: "w-auto", variant: "neutral", disabled: sandwichFunctionName === undefined || sandwichFunctionName.length === 0, children: "Reset view" }) }) }));
|
|
20
20
|
};
|
|
21
21
|
const Divider = () => (_jsx("div", { className: "border-t mt-4 border-gray-200 dark:border-gray-700 h-[1px] w-full pb-4" }));
|
|
22
|
-
export const VisualisationToolbar = ({ groupBy, toggleGroupBy, groupByLabels, setGroupByLabels, profileType,
|
|
22
|
+
export const VisualisationToolbar = ({ groupBy, toggleGroupBy, groupByLabels, setGroupByLabels, profileType, profileSource, queryClient, onDownloadPProf, pprofdownloading, profileViewExternalSubActions, curPath, setNewCurPath, total, filtered, currentSearchString, clearSelection, showVisualizationSelector = true, }) => {
|
|
23
23
|
const { dashboardItems } = useDashboard();
|
|
24
24
|
const isTableViz = dashboardItems?.includes('table');
|
|
25
25
|
const isTableVizOnly = dashboardItems?.length === 1 && isTableViz;
|
|
26
26
|
const isGraphViz = dashboardItems?.includes('icicle');
|
|
27
|
-
const
|
|
28
|
-
const isTableView = isTableVizOnly || isSandwichIcicleGraphViz;
|
|
27
|
+
const isGraphVizOnly = dashboardItems?.length === 1 && isGraphViz;
|
|
29
28
|
const req = profileSource?.QueryRequest();
|
|
30
29
|
if (req !== null && req !== undefined) {
|
|
31
30
|
req.groupBy = {
|
|
32
31
|
fields: groupBy ?? [],
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-end", children: [_jsxs("div", { className: "flex gap-3 items-end", children: [
|
|
34
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-end", children: [_jsxs("div", { className: "flex gap-3 items-end", children: [isGraphViz && (_jsxs(_Fragment, { children: [_jsx(GroupByDropdown, { groupBy: groupBy, labels: groupByLabels, setGroupByLabels: setGroupByLabels }), _jsx(InvertCallStack, {})] })), _jsx(FilterByFunctionButton, {}), profileViewExternalSubActions != null ? profileViewExternalSubActions : null] }), _jsxs("div", { className: "flex gap-3", children: [_jsx(MultiLevelDropdown, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, profileType: profileType, onSelect: () => { }, isTableVizOnly: isTableVizOnly }), _jsx(ShareButton, { profileSource: profileSource, queryClient: queryClient, queryRequest: req, onDownloadPProf: onDownloadPProf, pprofdownloading: pprofdownloading ?? false, profileViewExternalSubActions: profileViewExternalSubActions }), showVisualizationSelector ? _jsx(ViewSelector, { profileSource: profileSource }) : null] })] }), isGraphVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(IcicleGraphToolbar, { curPath: curPath, setNewCurPath: setNewCurPath })] })), isTableVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(TableToolbar, { profileType: profileType, total: total, filtered: filtered, clearSelection: clearSelection, currentSearchString: currentSearchString })] }))] }));
|
|
36
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAGrD,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,QAAA,MAAM,YAAY,sBAAqB,KAAK,KAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAGrD,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,QAAA,MAAM,YAAY,sBAAqB,KAAK,KAAG,GAAG,CAAC,OAqJlD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -5,10 +5,11 @@ const ViewSelector = ({ profileSource }) => {
|
|
|
5
5
|
const [dashboardItems = ['icicle'], setDashboardItems] = useURLState('dashboard_items', {
|
|
6
6
|
alwaysReturnArray: true,
|
|
7
7
|
});
|
|
8
|
+
const [, setSandwichFunctionName] = useURLState('sandwich_function_name');
|
|
8
9
|
const { enableSourcesView, enableSandwichView } = useParcaContext();
|
|
9
10
|
const allItems = [
|
|
10
|
-
{ key: 'table', label: 'Table', canBeSelected: !dashboardItems.includes('table') },
|
|
11
11
|
{ key: 'icicle', label: 'icicle', canBeSelected: !dashboardItems.includes('icicle') },
|
|
12
|
+
{ key: 'table', label: 'Table', canBeSelected: !dashboardItems.includes('table') },
|
|
12
13
|
{
|
|
13
14
|
key: 'iciclechart',
|
|
14
15
|
label: (_jsxs("span", { className: "relative", children: ["Iciclechart", _jsx("span", { className: "absolute top-[-2px] text-xs lowercase text-red-500", children: "\u00A0alpha" })] })),
|
|
@@ -38,26 +39,28 @@ const ViewSelector = ({ profileSource }) => {
|
|
|
38
39
|
const getInnerActionForItem = (item) => {
|
|
39
40
|
if (dashboardItems.length === 1 && item.key === dashboardItems[0])
|
|
40
41
|
return undefined;
|
|
41
|
-
//
|
|
42
|
-
if (item.key
|
|
43
|
-
return
|
|
44
|
-
text: 'Add Panel',
|
|
45
|
-
onClick: () => { },
|
|
46
|
-
isDisabled: true, // Custom property to control button state
|
|
47
|
-
};
|
|
48
|
-
}
|
|
42
|
+
// If we already have 2 panels and this item isn't selected, don't show any action
|
|
43
|
+
if (dashboardItems.length >= 2 && !dashboardItems.includes(item.key))
|
|
44
|
+
return undefined;
|
|
49
45
|
return {
|
|
50
46
|
text: !item.canBeSelected && item.key === 'source'
|
|
51
47
|
? 'Add Panel'
|
|
52
48
|
: item.canBeSelected
|
|
53
49
|
? 'Add Panel'
|
|
54
|
-
:
|
|
50
|
+
: dashboardItems.includes(item.key)
|
|
51
|
+
? 'Close Panel'
|
|
52
|
+
: 'Add Panel',
|
|
55
53
|
onClick: () => {
|
|
56
54
|
if (item.canBeSelected) {
|
|
57
55
|
setDashboardItems([...dashboardItems, item.key]);
|
|
58
56
|
}
|
|
59
57
|
else {
|
|
60
|
-
|
|
58
|
+
const newDashboardItems = dashboardItems.filter(v => v !== item.key);
|
|
59
|
+
setDashboardItems(newDashboardItems);
|
|
60
|
+
// Reset sandwich function name when removing sandwich panel
|
|
61
|
+
if (item.key === 'sandwich') {
|
|
62
|
+
setSandwichFunctionName(undefined);
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
},
|
|
63
66
|
isDisabled: dashboardItems.length === 1 && dashboardItems.includes('sandwich'),
|
|
@@ -72,6 +75,10 @@ const ViewSelector = ({ profileSource }) => {
|
|
|
72
75
|
}));
|
|
73
76
|
const onSelection = (value) => {
|
|
74
77
|
const isOnlyChart = dashboardItems.length === 1;
|
|
78
|
+
if (isOnlyChart && value === 'sandwich') {
|
|
79
|
+
setDashboardItems([...dashboardItems, value]);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
75
82
|
if (isOnlyChart) {
|
|
76
83
|
setDashboardItems([value]);
|
|
77
84
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardContext.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/context/DashboardContext.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AAIvE,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD,UAAU,oBAAoB;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAID,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"DashboardContext.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/context/DashboardContext.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AAIvE,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD,UAAU,oBAAoB;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAID,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CA8BnD,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,oBAM/B,CAAC"}
|
|
@@ -18,9 +18,14 @@ export const DashboardProvider = ({ children }) => {
|
|
|
18
18
|
const [dashboardItems, setDashboardItems] = useURLState('dashboard_items', {
|
|
19
19
|
alwaysReturnArray: true,
|
|
20
20
|
});
|
|
21
|
+
const [, setSandwichFunctionName] = useURLState('sandwich_function_name');
|
|
21
22
|
const handleClosePanel = (visualizationType) => {
|
|
22
23
|
const newDashboardItems = dashboardItems.filter(item => item !== visualizationType);
|
|
23
24
|
setDashboardItems(newDashboardItems);
|
|
25
|
+
// Reset sandwich function name when closing sandwich panel
|
|
26
|
+
if (visualizationType === 'sandwich') {
|
|
27
|
+
setSandwichFunctionName(undefined);
|
|
28
|
+
}
|
|
24
29
|
};
|
|
25
30
|
const isMultiPanelView = dashboardItems.length > 1;
|
|
26
31
|
return (_jsx(DashboardContext.Provider, { value: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileView/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileView/index.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAC,gBAAgB,EAAoB,MAAM,uBAAuB,CAAC;AAE/E,eAAO,MAAM,WAAW,sLAarB,gBAAgB,KAAG,GAAG,CAAC,OA4IzB,CAAC"}
|
|
@@ -18,7 +18,7 @@ import ColorStackLegend from './components/ColorStackLegend';
|
|
|
18
18
|
import { getDashboardItem } from './components/DashboardItems';
|
|
19
19
|
import { DashboardLayout } from './components/DashboardLayout';
|
|
20
20
|
import { ProfileHeader } from './components/ProfileHeader';
|
|
21
|
-
import { IcicleGraphToolbar, TableToolbar, VisualisationToolbar } from './components/Toolbars';
|
|
21
|
+
import { IcicleGraphToolbar, SandwichIcicleGraphToolbar, TableToolbar, VisualisationToolbar, } from './components/Toolbars';
|
|
22
22
|
import { DashboardProvider } from './context/DashboardContext';
|
|
23
23
|
import { ProfileViewContextProvider } from './context/ProfileViewContext';
|
|
24
24
|
import { useProfileMetadata } from './hooks/useProfileMetadata';
|
|
@@ -26,7 +26,7 @@ import { useVisualizationState } from './hooks/useVisualizationState';
|
|
|
26
26
|
export const ProfileView = ({ total, filtered, flamegraphData, flamechartData, topTableData, sourceData, profileSource, queryClient, onDownloadPProf, pprofDownloading, compare, showVisualizationSelector, }) => {
|
|
27
27
|
const { timezone, perf, profileViewExternalMainActions, preferencesModal, profileViewExternalSubActions, } = useParcaContext();
|
|
28
28
|
const { ref, dimensions } = useContainerDimensions();
|
|
29
|
-
const { curPath, setCurPath, curPathArrow, setCurPathArrow, currentSearchString, setSearchString, colorStackLegend, colorBy, groupBy, toggleGroupBy, clearSelection, setGroupByLabels, sandwichFunctionName,
|
|
29
|
+
const { curPath, setCurPath, curPathArrow, setCurPathArrow, currentSearchString, setSearchString, colorStackLegend, colorBy, groupBy, toggleGroupBy, clearSelection, setGroupByLabels, sandwichFunctionName, resetSandwichFunctionName, } = useVisualizationState();
|
|
30
30
|
const { colorMappings } = useProfileMetadata({
|
|
31
31
|
flamegraphArrow: flamegraphData.arrow,
|
|
32
32
|
metadataMappingFiles: flamegraphData.metadataMappingFiles,
|
|
@@ -61,7 +61,8 @@ export const ProfileView = ({ total, filtered, flamegraphData, flamechartData, t
|
|
|
61
61
|
const actionButtons = {
|
|
62
62
|
icicle: _jsx(IcicleGraphToolbar, { curPath: curPathArrow, setNewCurPath: setCurPathArrow }),
|
|
63
63
|
table: (_jsx(TableToolbar, { profileType: profileSource?.ProfileType(), total: total, filtered: filtered, clearSelection: clearSelection, currentSearchString: currentSearchString })),
|
|
64
|
+
sandwich: (_jsx(SandwichIcicleGraphToolbar, { resetSandwichFunctionName: resetSandwichFunctionName, sandwichFunctionName: sandwichFunctionName })),
|
|
64
65
|
};
|
|
65
66
|
const hasProfileSource = profileSource !== undefined && profileSource.toString(timezone) !== '';
|
|
66
|
-
return (_jsx(KeyDownProvider, { children: _jsx(ProfileViewContextProvider, { value: { profileSource, compareMode }, children: _jsxs(DashboardProvider, { children: [_jsx(ProfileHeader, { profileSourceString: profileSource?.toString(timezone), hasProfileSource: hasProfileSource, externalMainActions: profileViewExternalMainActions }), _jsx(VisualisationToolbar, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, hasProfileSource: hasProfileSource, pprofdownloading: pprofDownloading, profileSource: profileSource, queryClient: queryClient, onDownloadPProf: onDownloadPProf, curPath: curPathArrow, setNewCurPath: setCurPathArrow, profileType: profileSource?.ProfileType(), total: total, filtered: filtered, currentSearchString: currentSearchString, setSearchString: setSearchString, groupByLabels: flamegraphData.metadataLabels ?? [], preferencesModal: preferencesModal, profileViewExternalSubActions: profileViewExternalSubActions, clearSelection: clearSelection, setGroupByLabels: setGroupByLabels, showVisualizationSelector: showVisualizationSelector, sandwichFunctionName: sandwichFunctionName
|
|
67
|
+
return (_jsx(KeyDownProvider, { children: _jsx(ProfileViewContextProvider, { value: { profileSource, compareMode }, children: _jsxs(DashboardProvider, { children: [_jsx(ProfileHeader, { profileSourceString: profileSource?.toString(timezone), hasProfileSource: hasProfileSource, externalMainActions: profileViewExternalMainActions }), _jsx(VisualisationToolbar, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, hasProfileSource: hasProfileSource, pprofdownloading: pprofDownloading, profileSource: profileSource, queryClient: queryClient, onDownloadPProf: onDownloadPProf, curPath: curPathArrow, setNewCurPath: setCurPathArrow, profileType: profileSource?.ProfileType(), total: total, filtered: filtered, currentSearchString: currentSearchString, setSearchString: setSearchString, groupByLabels: flamegraphData.metadataLabels ?? [], preferencesModal: preferencesModal, profileViewExternalSubActions: profileViewExternalSubActions, clearSelection: clearSelection, setGroupByLabels: setGroupByLabels, showVisualizationSelector: showVisualizationSelector, sandwichFunctionName: sandwichFunctionName }), isColorStackLegendEnabled && (_jsx(ColorStackLegend, { compareMode: compareMode, mappings: colorMappings, loading: flamegraphData.metadataLoading })), _jsx("div", { className: "w-full", ref: ref, children: _jsx(DashboardLayout, { getDashboardItemByType: getDashboardItemByType, actionButtons: actionButtons }) })] }) }) }));
|
|
67
68
|
};
|
|
@@ -4,7 +4,6 @@ import { type CurrentPathFrame } from '../../ProfileIcicleGraph/IcicleGraphArrow
|
|
|
4
4
|
import { type ProfileSource } from '../../ProfileSource';
|
|
5
5
|
interface CalleesSectionProps {
|
|
6
6
|
calleesRef: React.RefObject<HTMLDivElement>;
|
|
7
|
-
isHalfScreen: boolean;
|
|
8
7
|
calleesFlamegraphResponse?: {
|
|
9
8
|
report: {
|
|
10
9
|
oneofKind: string;
|
|
@@ -20,6 +19,6 @@ interface CalleesSectionProps {
|
|
|
20
19
|
setCurPathArrow: (path: CurrentPathFrame[]) => void;
|
|
21
20
|
metadataMappingFiles?: string[];
|
|
22
21
|
}
|
|
23
|
-
export declare function CalleesSection({ calleesRef,
|
|
22
|
+
export declare function CalleesSection({ calleesRef, calleesFlamegraphResponse, calleesFlamegraphLoading, calleesFlamegraphError, filtered, profileSource, curPathArrow, setCurPathArrow, metadataMappingFiles, }: CalleesSectionProps): JSX.Element;
|
|
24
23
|
export {};
|
|
25
24
|
//# sourceMappingURL=CalleesSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalleesSection.d.ts","sourceRoot":"","sources":["../../../src/Sandwich/components/CalleesSection.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,eAAe,CAAC;AAGnD,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAC,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAEvD,UAAU,mBAAmB;IAC3B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,
|
|
1
|
+
{"version":3,"file":"CalleesSection.d.ts","sourceRoot":"","sources":["../../../src/Sandwich/components/CalleesSection.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,eAAe,CAAC;AAGnD,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAC,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAEvD,UAAU,mBAAmB;IAC3B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,yBAAyB,CAAC,EAAE;QAC1B,MAAM,EAAE;YACN,SAAS,EAAE,MAAM,CAAC;YAClB,eAAe,CAAC,EAAE,eAAe,CAAC;SACnC,CAAC;QACF,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,wBAAwB,EAAE,OAAO,CAAC;IAClC,sBAAsB,EAAE,GAAG,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,eAAe,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IACpD,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,eAAe,EACf,oBAAoB,GACrB,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CA+BnC"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import ProfileIcicleGraph from '../../ProfileIcicleGraph';
|
|
3
|
-
export function CalleesSection({ calleesRef,
|
|
3
|
+
export function CalleesSection({ calleesRef, calleesFlamegraphResponse, calleesFlamegraphLoading, calleesFlamegraphError, filtered, profileSource, curPathArrow, setCurPathArrow, metadataMappingFiles, }) {
|
|
4
4
|
return (_jsxs("div", { className: "flex relative items-start flex-row", ref: calleesRef, children: [_jsxs("div", { className: "[writing-mode:vertical-lr] -rotate-180 px-1 uppercase text-[10px] text-left", children: ['<-', " Callees"] }), _jsx(ProfileIcicleGraph, { arrow: calleesFlamegraphResponse?.report.oneofKind === 'flamegraphArrow'
|
|
5
5
|
? calleesFlamegraphResponse?.report?.flamegraphArrow
|
|
6
|
-
: undefined, total: BigInt(calleesFlamegraphResponse?.total ?? '0'), filtered: filtered, profileType: profileSource?.ProfileType(), loading: calleesFlamegraphLoading, error: calleesFlamegraphError, isHalfScreen: true, width: calleesRef.current != null
|
|
7
|
-
? isHalfScreen
|
|
8
|
-
? (calleesRef.current.getBoundingClientRect().width - 54) / 2
|
|
9
|
-
: calleesRef.current.getBoundingClientRect().width - 16
|
|
10
|
-
: 0, metadataMappingFiles: metadataMappingFiles, metadataLoading: false, isSandwichIcicleGraph: true, curPathArrow: curPathArrow, setNewCurPathArrow: setCurPathArrow, profileSource: profileSource, tooltipId: "callees" })] }));
|
|
6
|
+
: undefined, total: BigInt(calleesFlamegraphResponse?.total ?? '0'), filtered: filtered, profileType: profileSource?.ProfileType(), loading: calleesFlamegraphLoading, error: calleesFlamegraphError, isHalfScreen: true, width: calleesRef.current != null ? calleesRef.current.getBoundingClientRect().width - 25 : 0, metadataMappingFiles: metadataMappingFiles, metadataLoading: false, isSandwichIcicleGraph: true, curPathArrow: curPathArrow, setNewCurPathArrow: setCurPathArrow, profileSource: profileSource, tooltipId: "callees" })] }));
|
|
11
7
|
}
|
|
@@ -4,7 +4,6 @@ import { type CurrentPathFrame } from '../../ProfileIcicleGraph/IcicleGraphArrow
|
|
|
4
4
|
import { type ProfileSource } from '../../ProfileSource';
|
|
5
5
|
interface CallersSectionProps {
|
|
6
6
|
callersRef: React.RefObject<HTMLDivElement>;
|
|
7
|
-
isHalfScreen: boolean;
|
|
8
7
|
callersFlamegraphResponse?: {
|
|
9
8
|
report: {
|
|
10
9
|
oneofKind: string;
|
|
@@ -19,7 +18,10 @@ interface CallersSectionProps {
|
|
|
19
18
|
curPathArrow: CurrentPathFrame[];
|
|
20
19
|
setCurPathArrow: (path: CurrentPathFrame[]) => void;
|
|
21
20
|
metadataMappingFiles?: string[];
|
|
21
|
+
isExpanded: boolean;
|
|
22
|
+
setIsExpanded: (isExpanded: boolean) => void;
|
|
23
|
+
defaultMaxFrames: number;
|
|
22
24
|
}
|
|
23
|
-
export declare function CallersSection({ callersRef,
|
|
25
|
+
export declare function CallersSection({ callersRef, callersFlamegraphResponse, callersFlamegraphLoading, callersFlamegraphError, filtered, profileSource, curPathArrow, setCurPathArrow, metadataMappingFiles, isExpanded, setIsExpanded, defaultMaxFrames, }: CallersSectionProps): JSX.Element;
|
|
24
26
|
export {};
|
|
25
27
|
//# sourceMappingURL=CallersSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallersSection.d.ts","sourceRoot":"","sources":["../../../src/Sandwich/components/CallersSection.tsx"],"names":[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"CallersSection.d.ts","sourceRoot":"","sources":["../../../src/Sandwich/components/CallersSection.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAKrC,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,eAAe,CAAC;AAInD,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAC,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAevD,UAAU,mBAAmB;IAC3B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,yBAAyB,CAAC,EAAE;QAC1B,MAAM,EAAE;YACN,SAAS,EAAE,MAAM,CAAC;YAClB,eAAe,CAAC,EAAE,eAAe,CAAC;SACnC,CAAC;QACF,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,wBAAwB,EAAE,OAAO,CAAC;IAClC,sBAAsB,EAAE,GAAG,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,eAAe,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IACpD,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,gBAAgB,GACjB,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAwEnC"}
|
|
@@ -1,11 +1,47 @@
|
|
|
1
|
-
import { jsxs as _jsxs,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2022 The Parca Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { useMemo } from 'react';
|
|
15
|
+
import { tableFromIPC } from 'apache-arrow';
|
|
16
|
+
import { Tooltip } from 'react-tooltip';
|
|
17
|
+
import { Button } from '@parca/components';
|
|
2
18
|
import ProfileIcicleGraph from '../../ProfileIcicleGraph';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
19
|
+
const FIELD_DEPTH = 'depth';
|
|
20
|
+
function getMaxDepth(depthColumn) {
|
|
21
|
+
if (depthColumn === null)
|
|
22
|
+
return 0;
|
|
23
|
+
let max = 0;
|
|
24
|
+
for (const val of depthColumn) {
|
|
25
|
+
const numVal = Number(val);
|
|
26
|
+
if (numVal > max)
|
|
27
|
+
max = numVal;
|
|
28
|
+
}
|
|
29
|
+
return max;
|
|
30
|
+
}
|
|
31
|
+
export function CallersSection({ callersRef, callersFlamegraphResponse, callersFlamegraphLoading, callersFlamegraphError, filtered, profileSource, curPathArrow, setCurPathArrow, metadataMappingFiles, isExpanded, setIsExpanded, defaultMaxFrames, }) {
|
|
32
|
+
const maxDepth = useMemo(() => {
|
|
33
|
+
if (callersFlamegraphResponse?.report.oneofKind === 'flamegraphArrow' &&
|
|
34
|
+
callersFlamegraphResponse?.report?.flamegraphArrow != null) {
|
|
35
|
+
const table = tableFromIPC(callersFlamegraphResponse.report.flamegraphArrow.record);
|
|
36
|
+
const depthColumn = table.getChild(FIELD_DEPTH);
|
|
37
|
+
return getMaxDepth(depthColumn);
|
|
38
|
+
}
|
|
39
|
+
return 0;
|
|
40
|
+
}, [callersFlamegraphResponse]);
|
|
41
|
+
const shouldShowButton = maxDepth > defaultMaxFrames;
|
|
42
|
+
return (_jsxs(_Fragment, { children: [shouldShowButton && (_jsxs(Button, { variant: "neutral", onClick: () => setIsExpanded(!isExpanded), className: "absolute right-8 top-[-46px] z-10", type: "button", children: [_jsx("span", { "data-tooltip-content": !isExpanded
|
|
43
|
+
? `This profile has ${maxDepth} frames, showing only the top ${defaultMaxFrames} frames. Click to show more frames.`
|
|
44
|
+
: `This profile has ${maxDepth} frames, showing all frames. Click to hide frames.`, "data-tooltip-id": "show-more-frames", children: isExpanded ? 'Hide frames' : 'Show more frames' }), _jsx(Tooltip, { id: "show-more-frames" })] })), _jsxs("div", { className: "flex relative flex-row overflow-hidden", ref: callersRef, children: [_jsxs("div", { className: "[writing-mode:vertical-lr] -rotate-180 px-1 uppercase text-[10px] text-left flex-shrink-0", children: ["Callers ", '->'] }), _jsx("div", { className: "flex-1 overflow-hidden relative", children: _jsx(ProfileIcicleGraph, { arrow: callersFlamegraphResponse?.report.oneofKind === 'flamegraphArrow'
|
|
45
|
+
? callersFlamegraphResponse?.report?.flamegraphArrow
|
|
46
|
+
: undefined, total: BigInt(callersFlamegraphResponse?.total ?? '0'), filtered: filtered, profileType: profileSource?.ProfileType(), loading: callersFlamegraphLoading, error: callersFlamegraphError, isHalfScreen: true, width: callersRef.current != null ? callersRef.current.getBoundingClientRect().width - 25 : 0, metadataMappingFiles: metadataMappingFiles, metadataLoading: false, isSandwichIcicleGraph: true, curPathArrow: curPathArrow, setNewCurPathArrow: setCurPathArrow, isFlamegraph: true, profileSource: profileSource, tooltipId: "callers", maxFrameCount: defaultMaxFrames, isExpanded: isExpanded }) })] })] }));
|
|
11
47
|
}
|
|
@@ -2,5 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Table as TableComponent } from '@parca/components';
|
|
3
3
|
import { ROW_HEIGHT } from '../../Table/utils/functions';
|
|
4
4
|
export function TableSection({ rows, columns, initialSorting, selectedRow, onRowClick, shouldHighlightRow, enableHighlighting, columnVisibility, height, sandwichFunctionName, }) {
|
|
5
|
-
return (_jsx("div", { style: { height: height !== undefined ? `${height}px` : '80vh' }, className: `font-robotoMono
|
|
5
|
+
return (_jsx("div", { style: { height: height !== undefined ? `${height}px` : '80vh' }, className: `font-robotoMono cursor-pointer ${selectedRow != null && sandwichFunctionName !== undefined ? 'w-[50%]' : 'w-full'}`, children: _jsx(TableComponent, { data: rows, columns: columns, initialSorting: initialSorting, usePointerCursor: true, onRowClick: onRowClick, shouldHighlightRow: shouldHighlightRow, enableHighlighting: enableHighlighting, estimatedRowHeight: ROW_HEIGHT, columnVisibility: columnVisibility }) }));
|
|
6
6
|
}
|
package/dist/Sandwich/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Sandwich/index.tsx"],"names":[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Sandwich/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAMlE,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAG1E,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAK1C,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAU/C,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,QAAA,MAAM,QAAQ,mCA2MZ,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
package/dist/Sandwich/index.js
CHANGED
|
@@ -11,34 +11,32 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import React, {
|
|
14
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
15
15
|
import { tableFromIPC } from 'apache-arrow';
|
|
16
16
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
17
17
|
import { QueryRequest_ReportType } from '@parca/client';
|
|
18
|
-
import {
|
|
18
|
+
import { useParcaContext, useURLState } from '@parca/components';
|
|
19
19
|
import { useCurrentColorProfile } from '@parca/hooks';
|
|
20
|
-
import { isSearchMatch } from '@parca/utilities';
|
|
21
20
|
import useMappingList, { useFilenamesList, } from '../ProfileIcicleGraph/IcicleGraphArrow/useMappingList';
|
|
22
|
-
import {
|
|
21
|
+
import { useDashboard } from '../ProfileView/context/DashboardContext';
|
|
23
22
|
import { useVisualizationState } from '../ProfileView/hooks/useVisualizationState';
|
|
24
23
|
import { FIELD_FUNCTION_NAME } from '../Table';
|
|
25
24
|
import { useColorManagement } from '../Table/hooks/useColorManagement';
|
|
26
|
-
import { useTableConfiguration } from '../Table/hooks/useTableConfiguration';
|
|
27
25
|
import { useQuery } from '../useQuery';
|
|
28
26
|
import { CalleesSection } from './components/CalleesSection';
|
|
29
27
|
import { CallersSection } from './components/CallersSection';
|
|
30
|
-
import { TableSection } from './components/TableSection';
|
|
31
28
|
import { processRowData } from './utils/processRowData';
|
|
32
|
-
const Sandwich = React.memo(function Sandwich({ data,
|
|
29
|
+
const Sandwich = React.memo(function Sandwich({ data, filtered, profileType, loading, unit, metadataMappingFiles, queryClient, profileSource, }) {
|
|
33
30
|
const currentColorProfile = useCurrentColorProfile();
|
|
34
|
-
const
|
|
31
|
+
const { dashboardItems } = useDashboard();
|
|
32
|
+
const [sandwichFunctionName] = useURLState('sandwich_function_name');
|
|
35
33
|
const { isDarkMode } = useParcaContext();
|
|
36
34
|
const [selectedRow, setSelectedRow] = useState(null);
|
|
37
35
|
const callersRef = React.useRef(null);
|
|
38
36
|
const calleesRef = React.useRef(null);
|
|
37
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
38
|
+
const defaultMaxFrames = 10;
|
|
39
39
|
const callersCalleesContainerRef = useRef(null);
|
|
40
|
-
const [tableHeight, setTableHeight] = useState(undefined);
|
|
41
|
-
const { compareMode } = useProfileViewContext();
|
|
42
40
|
const { colorBy, setColorBy, curPathArrow, setCurPathArrow } = useVisualizationState();
|
|
43
41
|
const nodeTrimThreshold = useMemo(() => {
|
|
44
42
|
let width =
|
|
@@ -88,13 +86,6 @@ const Sandwich = React.memo(function Sandwich({ data, total, filtered, profileTy
|
|
|
88
86
|
colorBy,
|
|
89
87
|
});
|
|
90
88
|
unit = useMemo(() => unit ?? profileType?.sampleUnit ?? '', [unit, profileType?.sampleUnit]);
|
|
91
|
-
const tableConfig = useTableConfiguration({
|
|
92
|
-
unit,
|
|
93
|
-
total,
|
|
94
|
-
filtered,
|
|
95
|
-
compareMode,
|
|
96
|
-
});
|
|
97
|
-
const { columns, initialSorting, columnVisibility } = tableConfig;
|
|
98
89
|
const rows = useMemo(() => {
|
|
99
90
|
if (table == null || table.numRows === 0) {
|
|
100
91
|
return [];
|
|
@@ -116,67 +107,24 @@ const Sandwich = React.memo(function Sandwich({ data, total, filtered, profileTy
|
|
|
116
107
|
}
|
|
117
108
|
}
|
|
118
109
|
}, [sandwichFunctionName, rows, selectedRow]);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
window.removeEventListener('resize', updateTableHeight);
|
|
139
|
-
if (resizeObserver != null) {
|
|
140
|
-
resizeObserver.disconnect();
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
}, [sandwichFunctionName, callersFlamegraphResponse, calleesFlamegraphResponse]);
|
|
144
|
-
const onRowClick = useCallback((row) => {
|
|
145
|
-
setSelectedRow(row);
|
|
146
|
-
setSandwichFunctionName(row.name.trim());
|
|
147
|
-
}, [setSandwichFunctionName]);
|
|
148
|
-
const enableHighlighting = useMemo(() => {
|
|
149
|
-
return sandwichFunctionName != null && sandwichFunctionName?.length > 0;
|
|
150
|
-
}, [sandwichFunctionName]);
|
|
151
|
-
const shouldHighlightRow = useCallback((row) => {
|
|
152
|
-
if (!('name' in row)) {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
const name = row.name;
|
|
156
|
-
return isSearchMatch(sandwichFunctionName, name);
|
|
157
|
-
}, [sandwichFunctionName]);
|
|
158
|
-
if (loading) {
|
|
159
|
-
return (_jsx("div", { className: "overflow-clip h-[700px] min-h-[700px]", children: _jsx(TableSkeleton, { isHalfScreen: isHalfScreen, isDarkMode: isDarkMode }) }));
|
|
160
|
-
}
|
|
161
|
-
if (rows.length === 0) {
|
|
162
|
-
return _jsx("div", { className: "mx-auto text-center", children: "Profile has no samples" });
|
|
163
|
-
}
|
|
164
|
-
return (_jsx("section", { className: "flex flex-row h-full w-full", children: _jsx(AnimatePresence, { children: _jsx(motion.div, { className: "h-full w-full", initial: { display: 'none', opacity: 0 }, animate: { display: 'block', opacity: 1 }, transition: { duration: 0.5 }, children: _jsxs("div", { className: "relative flex flex-row", children: [_jsx(TableSection, { rows: rows, columns: columns, initialSorting: initialSorting, columnVisibility: columnVisibility, selectedRow: selectedRow, onRowClick: onRowClick, shouldHighlightRow: shouldHighlightRow, enableHighlighting: enableHighlighting, height: tableHeight, sandwichFunctionName: sandwichFunctionName }), sandwichFunctionName !== undefined && (_jsxs("div", { className: "w-[50%] flex flex-col", ref: callersCalleesContainerRef, children: [_jsx(CallersSection, { callersRef: callersRef, isHalfScreen: isHalfScreen, callersFlamegraphResponse: callersFlamegraphResponse?.report.oneofKind === 'flamegraphArrow'
|
|
165
|
-
? {
|
|
166
|
-
report: {
|
|
167
|
-
oneofKind: 'flamegraphArrow',
|
|
168
|
-
flamegraphArrow: callersFlamegraphResponse.report.flamegraphArrow,
|
|
169
|
-
},
|
|
170
|
-
total: callersFlamegraphResponse.total?.toString() ?? '0',
|
|
171
|
-
}
|
|
172
|
-
: undefined, callersFlamegraphLoading: callersFlamegraphLoading, callersFlamegraphError: callersFlamegraphError, filtered: filtered, profileSource: profileSource, curPathArrow: curPathArrow, setCurPathArrow: setCurPathArrow, metadataMappingFiles: metadataMappingFiles }), _jsx("div", { className: "h-4" }), _jsx(CalleesSection, { calleesRef: calleesRef, isHalfScreen: isHalfScreen, calleesFlamegraphResponse: calleesFlamegraphResponse?.report.oneofKind === 'flamegraphArrow'
|
|
173
|
-
? {
|
|
174
|
-
report: {
|
|
175
|
-
oneofKind: 'flamegraphArrow',
|
|
176
|
-
flamegraphArrow: calleesFlamegraphResponse.report.flamegraphArrow,
|
|
177
|
-
},
|
|
178
|
-
total: calleesFlamegraphResponse.total?.toString() ?? '0',
|
|
179
|
-
}
|
|
180
|
-
: undefined, calleesFlamegraphLoading: calleesFlamegraphLoading, calleesFlamegraphError: calleesFlamegraphError, filtered: filtered, profileSource: profileSource, curPathArrow: curPathArrow, setCurPathArrow: setCurPathArrow, metadataMappingFiles: metadataMappingFiles })] }))] }) }, "sandwich-loaded") }) }));
|
|
110
|
+
return (_jsx("section", { className: "flex flex-row h-full w-full", children: _jsx(AnimatePresence, { children: _jsx(motion.div, { className: "h-full w-full", initial: { display: 'none', opacity: 0 }, animate: { display: 'block', opacity: 1 }, transition: { duration: 0.5 }, children: _jsx("div", { className: "relative flex flex-row", children: sandwichFunctionName !== undefined ? (_jsxs("div", { className: "w-full flex flex-col", ref: callersCalleesContainerRef, children: [_jsx(CallersSection, { callersRef: callersRef, callersFlamegraphResponse: callersFlamegraphResponse?.report.oneofKind === 'flamegraphArrow'
|
|
111
|
+
? {
|
|
112
|
+
report: {
|
|
113
|
+
oneofKind: 'flamegraphArrow',
|
|
114
|
+
flamegraphArrow: callersFlamegraphResponse.report.flamegraphArrow,
|
|
115
|
+
},
|
|
116
|
+
total: callersFlamegraphResponse.total?.toString() ?? '0',
|
|
117
|
+
}
|
|
118
|
+
: undefined, callersFlamegraphLoading: callersFlamegraphLoading, callersFlamegraphError: callersFlamegraphError, filtered: filtered, profileSource: profileSource, curPathArrow: curPathArrow, setCurPathArrow: setCurPathArrow, metadataMappingFiles: metadataMappingFiles, isExpanded: isExpanded, setIsExpanded: setIsExpanded, defaultMaxFrames: defaultMaxFrames }), _jsx("div", { className: "h-4" }), _jsx(CalleesSection, { calleesRef: calleesRef, calleesFlamegraphResponse: calleesFlamegraphResponse?.report.oneofKind === 'flamegraphArrow'
|
|
119
|
+
? {
|
|
120
|
+
report: {
|
|
121
|
+
oneofKind: 'flamegraphArrow',
|
|
122
|
+
flamegraphArrow: calleesFlamegraphResponse.report.flamegraphArrow,
|
|
123
|
+
},
|
|
124
|
+
total: calleesFlamegraphResponse.total?.toString() ?? '0',
|
|
125
|
+
}
|
|
126
|
+
: undefined, calleesFlamegraphLoading: calleesFlamegraphLoading, calleesFlamegraphError: calleesFlamegraphError, filtered: filtered, profileSource: profileSource, curPathArrow: curPathArrow, setCurPathArrow: setCurPathArrow, metadataMappingFiles: metadataMappingFiles })] })) : (_jsx("div", { className: "items-center justify-center flex h-full w-full", children: _jsx("p", { className: "text-sm", children: dashboardItems.includes('table')
|
|
127
|
+
? 'Please select a function to view its callers and callees.'
|
|
128
|
+
: 'Use the right-click menu on the flame graph to choose a function to view its callers and callees.' }) })) }) }, "sandwich-loaded") }) }));
|
|
181
129
|
});
|
|
182
130
|
export default Sandwich;
|
|
@@ -8,6 +8,8 @@ interface Props {
|
|
|
8
8
|
currentQuery: Query;
|
|
9
9
|
profileType: string;
|
|
10
10
|
queryBrowserRef: React.RefObject<HTMLDivElement>;
|
|
11
|
+
start?: number;
|
|
12
|
+
end?: number;
|
|
11
13
|
}
|
|
12
14
|
export declare const transformLabelsForSelect: (labelNames: string[]) => SelectItem[];
|
|
13
15
|
export default function SimpleMathersWithProvider(props: Props): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SimpleMatchers/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAKpC,OAAe,EAAC,KAAK,UAAU,EAAC,MAAM,UAAU,CAAC;AAEjD,UAAU,KAAK;IACb,WAAW,EAAE,kBAAkB,CAAC;IAChC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,KAAK,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SimpleMatchers/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAKpC,OAAe,EAAC,KAAK,UAAU,EAAC,MAAM,UAAU,CAAC;AAEjD,UAAU,KAAK;IACb,WAAW,EAAE,kBAAkB,CAAC;IAChC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,KAAK,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAoBD,eAAO,MAAM,wBAAwB,eAAgB,MAAM,EAAE,KAAG,UAAU,EAQzE,CAAC;AAoWF,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAoB3E"}
|
|
@@ -16,7 +16,7 @@ import { Icon } from '@iconify/react';
|
|
|
16
16
|
import { useQueryClient } from '@tanstack/react-query';
|
|
17
17
|
import cx from 'classnames';
|
|
18
18
|
import { useGrpcMetadata } from '@parca/components';
|
|
19
|
-
import { sanitizeLabelValue } from '@parca/utilities';
|
|
19
|
+
import { millisToProtoTimestamp, sanitizeLabelValue } from '@parca/utilities';
|
|
20
20
|
import { LabelProvider, useLabels } from '../contexts/SimpleMatchersLabelContext';
|
|
21
21
|
import { useUtilizationLabels } from '../contexts/UtilizationLabelsContext';
|
|
22
22
|
import Select from './Select';
|
|
@@ -68,7 +68,7 @@ const operatorOptions = [
|
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
];
|
|
71
|
-
const SimpleMatchers = ({ queryClient, setMatchersString, currentQuery, profileType, queryBrowserRef, }) => {
|
|
71
|
+
const SimpleMatchers = ({ queryClient, setMatchersString, currentQuery, profileType, queryBrowserRef, start, end, }) => {
|
|
72
72
|
const utilizationLabels = useUtilizationLabels();
|
|
73
73
|
const [queryRows, setQueryRows] = useState([
|
|
74
74
|
{ labelName: '', operator: '=', labelValue: '', labelValues: [], isLoading: false },
|
|
@@ -85,8 +85,18 @@ const SimpleMatchers = ({ queryClient, setMatchersString, currentQuery, profileT
|
|
|
85
85
|
return [];
|
|
86
86
|
}
|
|
87
87
|
try {
|
|
88
|
-
const values = await reactQueryClient.fetchQuery([labelName, profileType], async () => {
|
|
89
|
-
const response = await queryClient.values({
|
|
88
|
+
const values = await reactQueryClient.fetchQuery([labelName, profileType, start, end], async () => {
|
|
89
|
+
const response = await queryClient.values({
|
|
90
|
+
labelName,
|
|
91
|
+
match: [],
|
|
92
|
+
profileType,
|
|
93
|
+
...(start !== undefined && end !== undefined
|
|
94
|
+
? {
|
|
95
|
+
start: millisToProtoTimestamp(start),
|
|
96
|
+
end: millisToProtoTimestamp(end),
|
|
97
|
+
}
|
|
98
|
+
: {}),
|
|
99
|
+
}, { meta: metadata }).response;
|
|
90
100
|
const sanitizedValues = sanitizeLabelValue(response.labelValues);
|
|
91
101
|
return sanitizedValues;
|
|
92
102
|
}, {
|
|
@@ -98,7 +108,7 @@ const SimpleMatchers = ({ queryClient, setMatchersString, currentQuery, profileT
|
|
|
98
108
|
console.error('Error fetching label values:', error);
|
|
99
109
|
return [];
|
|
100
110
|
}
|
|
101
|
-
}, [queryClient, metadata, profileType, reactQueryClient]);
|
|
111
|
+
}, [queryClient, metadata, profileType, reactQueryClient, start, end]);
|
|
102
112
|
const fetchLabelValuesUtilization = useCallback(async (labelName) => {
|
|
103
113
|
return (await utilizationLabels?.utilizationFetchLabelValues?.(labelName)) ?? [];
|
|
104
114
|
}, [utilizationLabels]);
|
|
@@ -242,5 +252,5 @@ export default function SimpleMathersWithProvider(props) {
|
|
|
242
252
|
const matchers = props.currentQuery.matchers;
|
|
243
253
|
return matchers.map(matcher => matcher.key);
|
|
244
254
|
}, [props.currentQuery]);
|
|
245
|
-
return (_jsx(LabelProvider, { queryClient: props.queryClient, profileType: props.profileType, labelNameFromMatchers: labelNameFromMatchers, children: _jsx(SimpleMatchers, { ...props }) }));
|
|
255
|
+
return (_jsx(LabelProvider, { queryClient: props.queryClient, profileType: props.profileType, labelNameFromMatchers: labelNameFromMatchers, start: props.start, end: props.end, children: _jsx(SimpleMatchers, { ...props }) }));
|
|
246
256
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoreDropdown.d.ts","sourceRoot":"","sources":["../../src/Table/MoreDropdown.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,YAAY,qBAAoB;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"MoreDropdown.d.ts","sourceRoot":"","sources":["../../src/Table/MoreDropdown.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,YAAY,qBAAoB;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IA4DlF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -16,14 +16,13 @@ import { Icon } from '@iconify/react';
|
|
|
16
16
|
import { useParcaContext, useURLState } from '@parca/components';
|
|
17
17
|
const MoreDropdown = ({ functionName }) => {
|
|
18
18
|
const [_, setSandwichFunctionName] = useURLState('sandwich_function_name');
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
19
|
const [dashboardItems, setDashboardItems] = useURLState('dashboard_items', {
|
|
21
20
|
alwaysReturnArray: true,
|
|
22
21
|
});
|
|
23
22
|
const { enableSandwichView } = useParcaContext();
|
|
24
23
|
const onSandwichViewSelect = () => {
|
|
25
24
|
setSandwichFunctionName(functionName.trim());
|
|
26
|
-
setDashboardItems(['sandwich']);
|
|
25
|
+
setDashboardItems([...dashboardItems, 'sandwich']);
|
|
27
26
|
};
|
|
28
27
|
const menuItems = [];
|
|
29
28
|
if (enableSandwichView === true) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import 'react-contexify/dist/ReactContexify.css';
|
|
2
|
+
import { type Row } from '.';
|
|
3
|
+
interface TableContextMenuProps {
|
|
4
|
+
menuId: string;
|
|
5
|
+
row: Row | null;
|
|
6
|
+
}
|
|
7
|
+
declare const TableContextMenu: ({ menuId, row }: TableContextMenuProps) => React.JSX.Element;
|
|
8
|
+
export default TableContextMenu;
|
|
9
|
+
//# sourceMappingURL=TableContextMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableContextMenu.d.ts","sourceRoot":"","sources":["../../src/Table/TableContextMenu.tsx"],"names":[],"mappings":"AAiBA,OAAO,yCAAyC,CAAC;AAIjD,OAAO,EAAC,KAAK,GAAG,EAAC,MAAM,GAAG,CAAC;AAE3B,UAAU,qBAAqB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;CACjB;AAED,QAAA,MAAM,gBAAgB,oBAAmB,qBAAqB,KAAG,KAAK,CAAC,GAAG,CAAC,OAuC1E,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|