@parca/profile 0.19.139 → 0.19.142
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 +224 -30
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
- package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
- package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/index.js +86 -56
- package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +103 -73
- package/dist/MatchersInput/SuggestionItem.js +91 -12
- package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
- package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
- package/dist/MatchersInput/SuggestionsList.js +371 -157
- package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
- package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
- package/dist/MatchersInput/index.js +308 -115
- package/dist/MetricsCircle/index.js +39 -3
- package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
- package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
- package/dist/MetricsGraph/index.js +552 -203
- package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
- package/dist/MetricsGraph/utils/colorMapping.js +24 -17
- package/dist/MetricsSeries/index.js +70 -7
- package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
- package/dist/PreSelectedMatchers/index.js +249 -102
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +240 -49
- package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
- package/dist/ProfileExplorer/index.js +183 -32
- package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
- package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
- package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
- package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
- package/dist/ProfileFlameChart/index.js +266 -134
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +287 -88
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
- package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +71 -45
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
- package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
- package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
- package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
- package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
- package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
- package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
- package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
- package/dist/ProfileFlameGraph/index.js +324 -148
- package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
- package/dist/ProfileMetricsGraph/index.js +518 -259
- package/dist/ProfileSelector/CompareButton.js +132 -12
- package/dist/ProfileSelector/MetricsGraphSection.js +234 -67
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +730 -142
- package/dist/ProfileSelector/useAutoQuerySelector.js +249 -130
- package/dist/ProfileSource.js +230 -163
- package/dist/ProfileTypeSelector/index.js +214 -125
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +139 -33
- package/dist/ProfileView/components/ColorStackLegend.js +184 -55
- package/dist/ProfileView/components/DashboardItems/index.js +87 -28
- package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
- package/dist/ProfileView/components/DiffLegend.js +172 -29
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
- package/dist/ProfileView/components/InvertCallStack/index.js +99 -10
- package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
- package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
- package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +188 -120
- package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
- package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
- package/dist/ProfileView/components/ShareButton/index.js +352 -62
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +675 -195
- package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +198 -157
- package/dist/ProfileView/components/Toolbars/index.js +441 -21
- package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
- package/dist/ProfileView/components/ViewSelector/index.js +211 -91
- package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
- package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
- package/dist/ProfileView/components/VisualizationPanel.js +185 -8
- package/dist/ProfileView/context/DashboardContext.js +84 -28
- package/dist/ProfileView/context/ProfileViewContext.js +56 -15
- package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
- package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
- package/dist/ProfileView/hooks/useResetFlameGraphState.js +31 -10
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +72 -29
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +39 -13
- package/dist/ProfileView/hooks/useVisualizationState.js +262 -87
- package/dist/ProfileView/index.js +383 -45
- package/dist/ProfileView/types/visualization.js +1 -13
- package/dist/ProfileView/utils/colorUtils.js +8 -7
- package/dist/ProfileViewWithData.js +332 -237
- package/dist/QueryControls/index.js +418 -47
- package/dist/Sandwich/components/CalleesSection.js +54 -4
- package/dist/Sandwich/components/CallersSection.js +97 -27
- package/dist/Sandwich/components/TableSection.js +77 -4
- package/dist/Sandwich/index.js +125 -12
- package/dist/Sandwich/utils/processRowData.js +48 -39
- package/dist/SelectWithRefresh/index.js +102 -28
- package/dist/SimpleMatchers/Select.js +520 -187
- package/dist/SimpleMatchers/index.js +590 -288
- package/dist/SourceView/Highlighter.js +230 -70
- package/dist/SourceView/LineNo.js +72 -17
- package/dist/SourceView/index.js +177 -101
- package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
- package/dist/SourceView/lang-detector/index.js +28 -14
- package/dist/SourceView/useSelectedLineRange.js +97 -16
- package/dist/Table/ColorCell.js +42 -1
- package/dist/Table/ColumnsVisibility.js +114 -6
- package/dist/Table/MoreDropdown.js +121 -27
- package/dist/Table/TableContextMenu.js +150 -139
- package/dist/Table/TableContextMenuWrapper.js +59 -14
- package/dist/Table/hooks/useColorManagement.js +58 -16
- package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
- package/dist/Table/hooks/useTableConfiguration.js +331 -168
- package/dist/Table/index.js +222 -126
- package/dist/Table/utils/functions.js +169 -144
- package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
- package/dist/TimelineGuide/index.js +209 -16
- package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
- package/dist/TopTable/index.js +340 -122
- package/dist/contexts/LabelsQueryProvider.js +94 -32
- package/dist/contexts/UnifiedLabelsContext.js +114 -49
- package/dist/contexts/utils.js +37 -15
- package/dist/hooks/useCompareModeMeta.js +157 -94
- package/dist/hooks/useLabels.js +295 -52
- package/dist/hooks/useQueryState.js +371 -330
- package/dist/index.js +21 -16
- package/dist/testdata/fg-diff.json +3750 -0
- package/dist/testdata/fg-simple.json +1879 -0
- package/dist/testdata/link_data.json +56 -0
- package/dist/testdata/tabular.json +30 -0
- package/dist/testdata/test_flamegraph.json +26846 -0
- package/dist/testdata/test_graph.json +53 -0
- package/dist/useDelayedLoader.js +32 -18
- package/dist/useGrpcQuery/index.js +71 -11
- package/dist/useHasProfileData.js +90 -12
- package/dist/useQuery.js +205 -64
- package/dist/useSumBy.d.ts.map +1 -1
- package/dist/useSumBy.js +294 -138
- package/dist/utils.js +62 -30
- package/package.json +9 -9
- package/src/GraphTooltipArrow/index.tsx +3 -0
- package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
- package/src/MatchersInput/SuggestionsList.tsx +11 -10
- package/src/MatchersInput/index.tsx +1 -1
- package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
- package/src/PreSelectedMatchers/index.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
- package/src/ProfileSelector/index.tsx +30 -7
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +3 -0
- package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
- package/src/Table/hooks/useTableConfiguration.tsx +7 -13
- package/src/useDelayedLoader.ts +10 -10
- package/src/useSumBy.ts +12 -18
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -541
- package/dist/hooks/useQueryState.test.js +0 -984
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
4
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
5
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
8
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
2
11
|
// Copyright 2022 The Parca Authors
|
|
3
12
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
13
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,6 +20,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
20
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
21
|
// See the License for the specific language governing permissions and
|
|
13
22
|
// limitations under the License.
|
|
23
|
+
|
|
14
24
|
import { Icon } from '@iconify/react';
|
|
15
25
|
import cx from 'classnames';
|
|
16
26
|
import { Item, Menu, Submenu } from 'react-contexify';
|
|
@@ -19,143 +29,144 @@ import { useParcaContext, useURLState, useURLStateBatch } from '@parca/component
|
|
|
19
29
|
import { valueFormatter } from '@parca/utilities';
|
|
20
30
|
import { getTextForCumulative } from '../ProfileFlameGraph/FlameGraphArrow/utils';
|
|
21
31
|
import { truncateString } from '../utils';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
+
var TableContextMenu = function TableContextMenu(_ref) {
|
|
34
|
+
var _row$name, _row$functionSystemNa, _row$functionFileName, _row$mappingFile;
|
|
35
|
+
var menuId = _ref.menuId,
|
|
36
|
+
row = _ref.row,
|
|
37
|
+
unit = _ref.unit,
|
|
38
|
+
total = _ref.total,
|
|
39
|
+
totalUnfiltered = _ref.totalUnfiltered,
|
|
40
|
+
columnVisibility = _ref.columnVisibility;
|
|
41
|
+
var _useURLState = useURLState('sandwich_function_name'),
|
|
42
|
+
_useURLState2 = _slicedToArray(_useURLState, 2),
|
|
43
|
+
_ = _useURLState2[0],
|
|
44
|
+
setSandwichFunctionName = _useURLState2[1];
|
|
45
|
+
var _useURLState3 = useURLState('dashboard_items', {
|
|
46
|
+
alwaysReturnArray: true
|
|
47
|
+
}),
|
|
48
|
+
_useURLState4 = _slicedToArray(_useURLState3, 2),
|
|
49
|
+
dashboardItems = _useURLState4[0],
|
|
50
|
+
setDashboardItems = _useURLState4[1];
|
|
51
|
+
var _useParcaContext = useParcaContext(),
|
|
52
|
+
enableSandwichView = _useParcaContext.enableSandwichView,
|
|
53
|
+
isDarkMode = _useParcaContext.isDarkMode;
|
|
54
|
+
var batchUpdates = useURLStateBatch();
|
|
55
|
+
var onSandwichViewSelect = function onSandwichViewSelect() {
|
|
56
|
+
if ((row === null || row === void 0 ? void 0 : row.name) != null && row.name.length > 0) {
|
|
57
|
+
// Batch updates to combine setSandwichFunctionName + setDashboardItems into single URL navigation
|
|
58
|
+
batchUpdates(function () {
|
|
59
|
+
setSandwichFunctionName(row.name.trim());
|
|
60
|
+
if (!dashboardItems.includes('sandwich')) {
|
|
61
|
+
setDashboardItems([].concat(_toConsumableArray(dashboardItems), ['sandwich']));
|
|
38
62
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
...(isColumnVisible('functionFileName')
|
|
148
|
-
? [{ id: 'Function File Name', value: row.functionFileName ?? '' }]
|
|
149
|
-
: []),
|
|
150
|
-
...(isColumnVisible('mappingFile')
|
|
151
|
-
? [{ id: 'Mapping File', value: row.mappingFile ?? '' }]
|
|
152
|
-
: []),
|
|
153
|
-
].flat()
|
|
154
|
-
: [];
|
|
155
|
-
const nonEmptyValuesToCopy = valuesToCopy.filter(({ value }) => value !== '');
|
|
156
|
-
const isMenuDisabled = row === null || enableSandwichView !== true;
|
|
157
|
-
return (_jsxs(Menu, { id: menuId, theme: isDarkMode ? 'dark' : '', className: cx(dashboardItems.includes('sandwich') ? 'min-w-[350px] w-[350px]' : 'min-w-[260px] w-[260px]'), children: [_jsx(Item, { id: "sandwich-view", onClick: onSandwichViewSelect, disabled: isMenuDisabled, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "tdesign:sandwich-filled" }), _jsxs("div", { className: "relative", children: [dashboardItems.includes('sandwich')
|
|
158
|
-
? 'Focus sandwich on this frame.'
|
|
159
|
-
: 'Show in sandwich', _jsx("span", { className: "absolute top-[-2px] text-xs lowercase text-red-500", children: "\u00A0alpha" })] })] }) }), _jsx(Submenu, { label: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "ph:copy" }), _jsx("div", { children: "Copy" })] }), disabled: row === null, 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))) }) })] }));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var handleCopyItem = function handleCopyItem(text) {
|
|
67
|
+
void navigator.clipboard.writeText(text);
|
|
68
|
+
};
|
|
69
|
+
var isColumnVisible = function isColumnVisible(columnName) {
|
|
70
|
+
var _columnVisibility$col;
|
|
71
|
+
return (_columnVisibility$col = columnVisibility === null || columnVisibility === void 0 ? void 0 : columnVisibility[columnName]) !== null && _columnVisibility$col !== void 0 ? _columnVisibility$col : true;
|
|
72
|
+
};
|
|
73
|
+
var valuesToCopy = row !== null ? [].concat(_toConsumableArray(isColumnVisible('flat') ? [{
|
|
74
|
+
id: 'Flat',
|
|
75
|
+
value: total !== null && total !== undefined && totalUnfiltered !== null && totalUnfiltered !== undefined ? getTextForCumulative(row.flat, total, totalUnfiltered, unit !== null && unit !== void 0 ? unit : '') : valueFormatter(row.flat, unit !== null && unit !== void 0 ? unit : '', 1)
|
|
76
|
+
}] : []), _toConsumableArray(isColumnVisible('flatPercentage') ? [{
|
|
77
|
+
id: 'Flat (%)',
|
|
78
|
+
value: total !== null && total !== undefined && totalUnfiltered !== null && totalUnfiltered !== undefined ? getTextForCumulative(row.flat, total, totalUnfiltered, unit !== null && unit !== void 0 ? unit : '') : valueFormatter(row.flat, unit !== null && unit !== void 0 ? unit : '', 1)
|
|
79
|
+
}] : []), _toConsumableArray(isColumnVisible('flatDiff') ? [{
|
|
80
|
+
id: 'Flat Diff',
|
|
81
|
+
value: row.flatDiff !== 0n ? valueFormatter(row.flatDiff, unit !== null && unit !== void 0 ? unit : '', 1) : ''
|
|
82
|
+
}] : []), _toConsumableArray(isColumnVisible('flatDiffPercentage') ? [{
|
|
83
|
+
id: 'Flat Diff (%)',
|
|
84
|
+
value: row.flatDiff !== 0n ? valueFormatter(row.flatDiff, unit !== null && unit !== void 0 ? unit : '', 1) : ''
|
|
85
|
+
}] : []), _toConsumableArray(isColumnVisible('cumulative') ? [{
|
|
86
|
+
id: 'Cumulative',
|
|
87
|
+
value: total !== null && total !== undefined && totalUnfiltered !== null && totalUnfiltered !== undefined ? getTextForCumulative(row.cumulative, total, totalUnfiltered, unit !== null && unit !== void 0 ? unit : '') : valueFormatter(row.cumulative, unit !== null && unit !== void 0 ? unit : '', 1)
|
|
88
|
+
}] : []), _toConsumableArray(isColumnVisible('cumulativePercentage') ? [{
|
|
89
|
+
id: 'Cumulative (%)',
|
|
90
|
+
value: total !== null && total !== undefined && totalUnfiltered !== null && totalUnfiltered !== undefined ? getTextForCumulative(row.cumulative, total, totalUnfiltered, unit !== null && unit !== void 0 ? unit : '') : valueFormatter(row.cumulative, unit !== null && unit !== void 0 ? unit : '', 1)
|
|
91
|
+
}] : []), _toConsumableArray(isColumnVisible('cumulativeDiff') ? [{
|
|
92
|
+
id: 'Cumulative Diff',
|
|
93
|
+
value: row.cumulativeDiff !== 0n ? valueFormatter(row.cumulativeDiff, unit !== null && unit !== void 0 ? unit : '', 1) : ''
|
|
94
|
+
}] : []), _toConsumableArray(isColumnVisible('cumulativeDiffPercentage') ? [{
|
|
95
|
+
id: 'Cumulative Diff (%)',
|
|
96
|
+
value: row.cumulativeDiff !== 0n ? valueFormatter(row.cumulativeDiff, unit !== null && unit !== void 0 ? unit : '', 1) : ''
|
|
97
|
+
}] : []), _toConsumableArray(isColumnVisible('name') ? [{
|
|
98
|
+
id: 'Name',
|
|
99
|
+
value: (_row$name = row.name) !== null && _row$name !== void 0 ? _row$name : ''
|
|
100
|
+
}] : []), _toConsumableArray(isColumnVisible('functionSystemName') ? [{
|
|
101
|
+
id: 'Function System Name',
|
|
102
|
+
value: (_row$functionSystemNa = row.functionSystemName) !== null && _row$functionSystemNa !== void 0 ? _row$functionSystemNa : ''
|
|
103
|
+
}] : []), _toConsumableArray(isColumnVisible('functionFileName') ? [{
|
|
104
|
+
id: 'Function File Name',
|
|
105
|
+
value: (_row$functionFileName = row.functionFileName) !== null && _row$functionFileName !== void 0 ? _row$functionFileName : ''
|
|
106
|
+
}] : []), _toConsumableArray(isColumnVisible('mappingFile') ? [{
|
|
107
|
+
id: 'Mapping File',
|
|
108
|
+
value: (_row$mappingFile = row.mappingFile) !== null && _row$mappingFile !== void 0 ? _row$mappingFile : ''
|
|
109
|
+
}] : [])).flat() : [];
|
|
110
|
+
var nonEmptyValuesToCopy = valuesToCopy.filter(function (_ref2) {
|
|
111
|
+
var value = _ref2.value;
|
|
112
|
+
return value !== '';
|
|
113
|
+
});
|
|
114
|
+
var isMenuDisabled = row === null || enableSandwichView !== true;
|
|
115
|
+
return /*#__PURE__*/_jsxs(Menu, {
|
|
116
|
+
id: menuId,
|
|
117
|
+
theme: isDarkMode ? 'dark' : '',
|
|
118
|
+
className: cx(dashboardItems.includes('sandwich') ? 'min-w-[350px] w-[350px]' : 'min-w-[260px] w-[260px]'),
|
|
119
|
+
children: [/*#__PURE__*/_jsx(Item, {
|
|
120
|
+
id: "sandwich-view",
|
|
121
|
+
onClick: onSandwichViewSelect,
|
|
122
|
+
disabled: isMenuDisabled,
|
|
123
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
124
|
+
className: "flex w-full items-center gap-2",
|
|
125
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
126
|
+
icon: "tdesign:sandwich-filled"
|
|
127
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
128
|
+
className: "relative",
|
|
129
|
+
children: [dashboardItems.includes('sandwich') ? 'Focus sandwich on this frame.' : 'Show in sandwich', /*#__PURE__*/_jsx("span", {
|
|
130
|
+
className: "absolute top-[-2px] text-xs lowercase text-red-500",
|
|
131
|
+
children: "\xA0alpha"
|
|
132
|
+
})]
|
|
133
|
+
})]
|
|
134
|
+
})
|
|
135
|
+
}), /*#__PURE__*/_jsx(Submenu, {
|
|
136
|
+
label: /*#__PURE__*/_jsxs("div", {
|
|
137
|
+
className: "flex w-full items-center gap-2",
|
|
138
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
139
|
+
icon: "ph:copy"
|
|
140
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
141
|
+
children: "Copy"
|
|
142
|
+
})]
|
|
143
|
+
}),
|
|
144
|
+
disabled: row === null,
|
|
145
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
146
|
+
className: "max-h-[300px] overflow-scroll",
|
|
147
|
+
children: nonEmptyValuesToCopy.map(function (_ref3) {
|
|
148
|
+
var id = _ref3.id,
|
|
149
|
+
value_0 = _ref3.value;
|
|
150
|
+
return /*#__PURE__*/_jsx(Item, {
|
|
151
|
+
id: id,
|
|
152
|
+
onClick: function onClick() {
|
|
153
|
+
return handleCopyItem(value_0);
|
|
154
|
+
},
|
|
155
|
+
className: "dark:bg-gray-800",
|
|
156
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
157
|
+
className: "flex flex-col dark:text-gray-300 hover:dark:text-gray-100",
|
|
158
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
159
|
+
className: "text-sm",
|
|
160
|
+
children: id
|
|
161
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
162
|
+
className: "text-xs",
|
|
163
|
+
children: truncateString(value_0, 30)
|
|
164
|
+
})]
|
|
165
|
+
})
|
|
166
|
+
}, id);
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
})]
|
|
170
|
+
});
|
|
160
171
|
};
|
|
161
|
-
export default TableContextMenu;
|
|
172
|
+
export default TableContextMenu;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
8
|
// Copyright 2022 The Parca Authors
|
|
3
9
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
10
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,20 +17,59 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
17
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
18
|
// See the License for the specific language governing permissions and
|
|
13
19
|
// limitations under the License.
|
|
20
|
+
|
|
14
21
|
import { forwardRef, useImperativeHandle, useState } from 'react';
|
|
15
22
|
import TableContextMenu from './TableContextMenu';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
var TableContextMenuWrapper = /*#__PURE__*/forwardRef(function (t0, ref) {
|
|
25
|
+
var $ = _c(8);
|
|
26
|
+
var menuId = t0.menuId,
|
|
27
|
+
unit = t0.unit,
|
|
28
|
+
total = t0.total,
|
|
29
|
+
totalUnfiltered = t0.totalUnfiltered,
|
|
30
|
+
columnVisibility = t0.columnVisibility;
|
|
31
|
+
var _useState = useState(null),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
row = _useState2[0],
|
|
34
|
+
_setRow = _useState2[1];
|
|
35
|
+
var t1;
|
|
36
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
37
|
+
t1 = function t1() {
|
|
38
|
+
return {
|
|
39
|
+
setRow: function setRow(newRow, callback) {
|
|
40
|
+
_setRow(newRow);
|
|
41
|
+
if (callback != null) {
|
|
42
|
+
requestAnimationFrame(callback);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
$[0] = t1;
|
|
48
|
+
} else {
|
|
49
|
+
t1 = $[0];
|
|
50
|
+
}
|
|
51
|
+
useImperativeHandle(ref, t1);
|
|
52
|
+
var t2;
|
|
53
|
+
if ($[1] !== columnVisibility || $[2] !== menuId || $[3] !== row || $[4] !== total || $[5] !== totalUnfiltered || $[6] !== unit) {
|
|
54
|
+
t2 = /*#__PURE__*/_jsx(TableContextMenu, {
|
|
55
|
+
menuId: menuId,
|
|
56
|
+
row: row,
|
|
57
|
+
unit: unit,
|
|
58
|
+
total: total,
|
|
59
|
+
totalUnfiltered: totalUnfiltered,
|
|
60
|
+
columnVisibility: columnVisibility
|
|
61
|
+
});
|
|
62
|
+
$[1] = columnVisibility;
|
|
63
|
+
$[2] = menuId;
|
|
64
|
+
$[3] = row;
|
|
65
|
+
$[4] = total;
|
|
66
|
+
$[5] = totalUnfiltered;
|
|
67
|
+
$[6] = unit;
|
|
68
|
+
$[7] = t2;
|
|
69
|
+
} else {
|
|
70
|
+
t2 = $[7];
|
|
71
|
+
}
|
|
72
|
+
return t2;
|
|
28
73
|
});
|
|
29
74
|
TableContextMenuWrapper.displayName = 'TableContextMenuWrapper';
|
|
30
|
-
export default TableContextMenuWrapper;
|
|
75
|
+
export default TableContextMenuWrapper;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c as _c } from "react-compiler-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,23 +11,64 @@
|
|
|
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.
|
|
14
|
+
|
|
13
15
|
import { useMemo } from 'react';
|
|
14
16
|
import { getFilenameColors, getMappingColors } from '../../ProfileFlameGraph/FlameGraphArrow';
|
|
15
|
-
export function useColorManagement(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
export function useColorManagement(t0) {
|
|
18
|
+
var $ = _c(14);
|
|
19
|
+
var isDarkMode = t0.isDarkMode,
|
|
20
|
+
currentColorProfile = t0.currentColorProfile,
|
|
21
|
+
mappingsList = t0.mappingsList,
|
|
22
|
+
filenamesList = t0.filenamesList,
|
|
23
|
+
colorBy = t0.colorBy;
|
|
24
|
+
var t1;
|
|
25
|
+
if ($[0] !== currentColorProfile || $[1] !== filenamesList || $[2] !== isDarkMode) {
|
|
26
|
+
t1 = getFilenameColors(filenamesList, isDarkMode, currentColorProfile);
|
|
27
|
+
$[0] = currentColorProfile;
|
|
28
|
+
$[1] = filenamesList;
|
|
29
|
+
$[2] = isDarkMode;
|
|
30
|
+
$[3] = t1;
|
|
31
|
+
} else {
|
|
32
|
+
t1 = $[3];
|
|
33
|
+
}
|
|
34
|
+
var filenameColors = t1;
|
|
35
|
+
var t2;
|
|
36
|
+
if ($[4] !== currentColorProfile || $[5] !== isDarkMode || $[6] !== mappingsList) {
|
|
37
|
+
t2 = getMappingColors(mappingsList, isDarkMode, currentColorProfile);
|
|
38
|
+
$[4] = currentColorProfile;
|
|
39
|
+
$[5] = isDarkMode;
|
|
40
|
+
$[6] = mappingsList;
|
|
41
|
+
$[7] = t2;
|
|
42
|
+
} else {
|
|
43
|
+
t2 = $[7];
|
|
44
|
+
}
|
|
45
|
+
var mappingColors = t2;
|
|
46
|
+
var t3;
|
|
47
|
+
if ($[8] !== filenameColors || $[9] !== mappingColors) {
|
|
48
|
+
t3 = {
|
|
49
|
+
filename: filenameColors,
|
|
50
|
+
binary: mappingColors
|
|
25
51
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
52
|
+
$[8] = filenameColors;
|
|
53
|
+
$[9] = mappingColors;
|
|
54
|
+
$[10] = t3;
|
|
55
|
+
} else {
|
|
56
|
+
t3 = $[10];
|
|
57
|
+
}
|
|
58
|
+
var colorByList = t3;
|
|
59
|
+
var colorByValue = colorBy === undefined || colorBy === "" ? "binary" : colorBy;
|
|
60
|
+
var colorByColors = colorByList[colorByValue];
|
|
61
|
+
var t4;
|
|
62
|
+
if ($[11] !== colorByColors || $[12] !== colorByValue) {
|
|
63
|
+
t4 = {
|
|
64
|
+
colorByColors: colorByColors,
|
|
65
|
+
colorByValue: colorByValue
|
|
31
66
|
};
|
|
32
|
-
|
|
67
|
+
$[11] = colorByColors;
|
|
68
|
+
$[12] = colorByValue;
|
|
69
|
+
$[13] = t4;
|
|
70
|
+
} else {
|
|
71
|
+
t4 = $[13];
|
|
72
|
+
}
|
|
73
|
+
return t4;
|
|
74
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableConfiguration.d.ts","sourceRoot":"","sources":["../../../src/Table/hooks/useTableConfiguration.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAqB,KAAK,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAKxE,OAAO,EAAC,KAAK,GAAG,EAAC,MAAM,IAAI,CAAC;AAE5B,OAAO,EAA2B,KAAK,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE7E,UAAU,0BAA0B;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,cAAc,EAAE,KAAK,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IACnD,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;CAC/C;AAED,wBAAgB,qBAAqB,CAAC,EACpC,IAAS,EACT,KAAK,EACL,QAAQ,EACR,WAAW,GACZ,EAAE,0BAA0B,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"useTableConfiguration.d.ts","sourceRoot":"","sources":["../../../src/Table/hooks/useTableConfiguration.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAqB,KAAK,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAKxE,OAAO,EAAC,KAAK,GAAG,EAAC,MAAM,IAAI,CAAC;AAE5B,OAAO,EAA2B,KAAK,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE7E,UAAU,0BAA0B;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,cAAc,EAAE,KAAK,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IACnD,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;CAC/C;AAED,wBAAgB,qBAAqB,CAAC,EACpC,IAAS,EACT,KAAK,EACL,QAAQ,EACR,WAAW,GACZ,EAAE,0BAA0B,GAAG,kBAAkB,CAyKjD"}
|