@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.
Files changed (170) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/GraphTooltipArrow/Content.js +224 -30
  3. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
  4. package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
  5. package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
  6. package/dist/GraphTooltipArrow/index.js +86 -56
  7. package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
  8. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +103 -73
  9. package/dist/MatchersInput/SuggestionItem.js +91 -12
  10. package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
  11. package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
  12. package/dist/MatchersInput/SuggestionsList.js +371 -157
  13. package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
  14. package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
  15. package/dist/MatchersInput/index.js +308 -115
  16. package/dist/MetricsCircle/index.js +39 -3
  17. package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
  18. package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
  19. package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
  20. package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
  21. package/dist/MetricsGraph/index.js +552 -203
  22. package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
  23. package/dist/MetricsGraph/utils/colorMapping.js +24 -17
  24. package/dist/MetricsSeries/index.js +70 -7
  25. package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
  26. package/dist/PreSelectedMatchers/index.js +249 -102
  27. package/dist/ProfileExplorer/ProfileExplorerCompare.js +240 -49
  28. package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
  29. package/dist/ProfileExplorer/index.js +183 -32
  30. package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
  31. package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
  32. package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
  33. package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
  34. package/dist/ProfileFlameChart/index.js +266 -134
  35. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +287 -88
  36. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
  37. package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
  38. package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
  39. package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
  40. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  41. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +71 -45
  42. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
  43. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
  44. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
  45. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
  46. package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
  47. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
  48. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
  49. package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
  50. package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
  51. package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
  52. package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
  53. package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
  54. package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
  55. package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
  56. package/dist/ProfileFlameGraph/index.js +324 -148
  57. package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
  58. package/dist/ProfileMetricsGraph/index.js +518 -259
  59. package/dist/ProfileSelector/CompareButton.js +132 -12
  60. package/dist/ProfileSelector/MetricsGraphSection.js +234 -67
  61. package/dist/ProfileSelector/index.d.ts.map +1 -1
  62. package/dist/ProfileSelector/index.js +730 -142
  63. package/dist/ProfileSelector/useAutoQuerySelector.js +249 -130
  64. package/dist/ProfileSource.js +230 -163
  65. package/dist/ProfileTypeSelector/index.js +214 -125
  66. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
  67. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +139 -33
  68. package/dist/ProfileView/components/ColorStackLegend.js +184 -55
  69. package/dist/ProfileView/components/DashboardItems/index.js +87 -28
  70. package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
  71. package/dist/ProfileView/components/DiffLegend.js +172 -29
  72. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
  73. package/dist/ProfileView/components/InvertCallStack/index.js +99 -10
  74. package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
  75. package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
  76. package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
  77. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +188 -120
  78. package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
  79. package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
  80. package/dist/ProfileView/components/ShareButton/index.js +352 -62
  81. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  82. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +675 -195
  83. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
  84. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +198 -157
  85. package/dist/ProfileView/components/Toolbars/index.js +441 -21
  86. package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
  87. package/dist/ProfileView/components/ViewSelector/index.js +211 -91
  88. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
  89. package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
  90. package/dist/ProfileView/components/VisualizationPanel.js +185 -8
  91. package/dist/ProfileView/context/DashboardContext.js +84 -28
  92. package/dist/ProfileView/context/ProfileViewContext.js +56 -15
  93. package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
  94. package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
  95. package/dist/ProfileView/hooks/useResetFlameGraphState.js +31 -10
  96. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +72 -29
  97. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +39 -13
  98. package/dist/ProfileView/hooks/useVisualizationState.js +262 -87
  99. package/dist/ProfileView/index.js +383 -45
  100. package/dist/ProfileView/types/visualization.js +1 -13
  101. package/dist/ProfileView/utils/colorUtils.js +8 -7
  102. package/dist/ProfileViewWithData.js +332 -237
  103. package/dist/QueryControls/index.js +418 -47
  104. package/dist/Sandwich/components/CalleesSection.js +54 -4
  105. package/dist/Sandwich/components/CallersSection.js +97 -27
  106. package/dist/Sandwich/components/TableSection.js +77 -4
  107. package/dist/Sandwich/index.js +125 -12
  108. package/dist/Sandwich/utils/processRowData.js +48 -39
  109. package/dist/SelectWithRefresh/index.js +102 -28
  110. package/dist/SimpleMatchers/Select.js +520 -187
  111. package/dist/SimpleMatchers/index.js +590 -288
  112. package/dist/SourceView/Highlighter.js +230 -70
  113. package/dist/SourceView/LineNo.js +72 -17
  114. package/dist/SourceView/index.js +177 -101
  115. package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
  116. package/dist/SourceView/lang-detector/index.js +28 -14
  117. package/dist/SourceView/useSelectedLineRange.js +97 -16
  118. package/dist/Table/ColorCell.js +42 -1
  119. package/dist/Table/ColumnsVisibility.js +114 -6
  120. package/dist/Table/MoreDropdown.js +121 -27
  121. package/dist/Table/TableContextMenu.js +150 -139
  122. package/dist/Table/TableContextMenuWrapper.js +59 -14
  123. package/dist/Table/hooks/useColorManagement.js +58 -16
  124. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  125. package/dist/Table/hooks/useTableConfiguration.js +331 -168
  126. package/dist/Table/index.js +222 -126
  127. package/dist/Table/utils/functions.js +169 -144
  128. package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
  129. package/dist/TimelineGuide/index.js +209 -16
  130. package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
  131. package/dist/TopTable/index.js +340 -122
  132. package/dist/contexts/LabelsQueryProvider.js +94 -32
  133. package/dist/contexts/UnifiedLabelsContext.js +114 -49
  134. package/dist/contexts/utils.js +37 -15
  135. package/dist/hooks/useCompareModeMeta.js +157 -94
  136. package/dist/hooks/useLabels.js +295 -52
  137. package/dist/hooks/useQueryState.js +371 -330
  138. package/dist/index.js +21 -16
  139. package/dist/testdata/fg-diff.json +3750 -0
  140. package/dist/testdata/fg-simple.json +1879 -0
  141. package/dist/testdata/link_data.json +56 -0
  142. package/dist/testdata/tabular.json +30 -0
  143. package/dist/testdata/test_flamegraph.json +26846 -0
  144. package/dist/testdata/test_graph.json +53 -0
  145. package/dist/useDelayedLoader.js +32 -18
  146. package/dist/useGrpcQuery/index.js +71 -11
  147. package/dist/useHasProfileData.js +90 -12
  148. package/dist/useQuery.js +205 -64
  149. package/dist/useSumBy.d.ts.map +1 -1
  150. package/dist/useSumBy.js +294 -138
  151. package/dist/utils.js +62 -30
  152. package/package.json +9 -9
  153. package/src/GraphTooltipArrow/index.tsx +3 -0
  154. package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
  155. package/src/MatchersInput/SuggestionsList.tsx +11 -10
  156. package/src/MatchersInput/index.tsx +1 -1
  157. package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
  158. package/src/PreSelectedMatchers/index.tsx +3 -0
  159. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +3 -0
  160. package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
  161. package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
  162. package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
  163. package/src/ProfileSelector/index.tsx +30 -7
  164. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +3 -0
  165. package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
  166. package/src/Table/hooks/useTableConfiguration.tsx +7 -13
  167. package/src/useDelayedLoader.ts +10 -10
  168. package/src/useSumBy.ts +12 -18
  169. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -541
  170. package/dist/hooks/useQueryState.test.js +0 -984
@@ -1,10 +1,55 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ // Copyright 2022 The Parca Authors
8
+ // Licensed under the Apache License, Version 2.0 (the "License");
9
+ // you may not use this file except in compliance with the License.
10
+ // You may obtain a copy of the License at
11
+ //
12
+ // http://www.apache.org/licenses/LICENSE-2.0
13
+ //
14
+ // Unless required by applicable law or agreed to in writing, software
15
+ // distributed under the License is distributed on an "AS IS" BASIS,
16
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ // See the License for the specific language governing permissions and
18
+ // limitations under the License.
19
+
20
+ /* eslint-disable react-hooks/refs */
21
+
2
22
  import cx from 'classnames';
3
23
  import { useDashboard } from '../../context/DashboardContext';
4
24
  import { VisualizationPanel } from '../VisualizationPanel';
5
- export const VisualizationContainer = ({ provided, snapshot, dashboardItem, getDashboardItemByType, isMultiPanelView, index, actionButtons, }) => {
6
- const { handleClosePanel } = useDashboard();
7
- return (_jsx("div", { ref: provided.innerRef, ...provided.draggableProps, className: cx('w-full min-h-96', snapshot.isDragging ? 'bg-gray-200 dark:bg-gray-500' : 'bg-inherit dark:bg-gray-900', isMultiPanelView ? 'border-2 border-gray-100 dark:border-gray-700 rounded-md p-3' : '', dashboardItem === 'source' && isMultiPanelView ? 'sticky top-0 self-start' : ''), style: dashboardItem === 'source' && isMultiPanelView
8
- ? { maxHeight: 'calc(100vh - 50px)' }
9
- : undefined, children: _jsx(VisualizationPanel, { handleClosePanel: handleClosePanel, isMultiPanelView: isMultiPanelView, dashboardItem: dashboardItem, getDashboardItemByType: getDashboardItemByType, dragHandleProps: provided.dragHandleProps, index: index, actionButtons: actionButtons }) }));
10
- };
25
+ import { jsx as _jsx } from "react/jsx-runtime";
26
+ export var VisualizationContainer = function VisualizationContainer(_ref) {
27
+ 'use no memo';
28
+
29
+ var provided = _ref.provided,
30
+ snapshot = _ref.snapshot,
31
+ dashboardItem = _ref.dashboardItem,
32
+ getDashboardItemByType = _ref.getDashboardItemByType,
33
+ isMultiPanelView = _ref.isMultiPanelView,
34
+ index = _ref.index,
35
+ actionButtons = _ref.actionButtons;
36
+ var _useDashboard = useDashboard(),
37
+ handleClosePanel = _useDashboard.handleClosePanel;
38
+ return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
39
+ ref: provided.innerRef
40
+ }, provided.draggableProps), {}, {
41
+ className: cx('w-full min-h-96', snapshot.isDragging ? 'bg-gray-200 dark:bg-gray-500' : 'bg-inherit dark:bg-gray-900', isMultiPanelView ? 'border-2 border-gray-100 dark:border-gray-700 rounded-md p-3' : '', dashboardItem === 'source' && isMultiPanelView ? 'sticky top-0 self-start' : ''),
42
+ style: dashboardItem === 'source' && isMultiPanelView ? {
43
+ maxHeight: 'calc(100vh - 50px)'
44
+ } : undefined,
45
+ children: /*#__PURE__*/_jsx(VisualizationPanel, {
46
+ handleClosePanel: handleClosePanel,
47
+ isMultiPanelView: isMultiPanelView,
48
+ dashboardItem: dashboardItem,
49
+ getDashboardItemByType: getDashboardItemByType,
50
+ dragHandleProps: provided.dragHandleProps,
51
+ index: index,
52
+ actionButtons: actionButtons
53
+ })
54
+ }));
55
+ };
@@ -1,4 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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,15 +17,186 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
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 React from 'react';
15
22
  import { Icon } from '@iconify/react';
16
23
  import cx from 'classnames';
17
24
  import { IconButton, useParcaContext } from '@parca/components';
18
25
  import { CloseIcon } from '@parca/icons';
19
- export const VisualizationPanel = React.memo(function VisualizationPanel({ dashboardItem, isMultiPanelView, handleClosePanel, dragHandleProps, getDashboardItemByType, actionButtons, }) {
20
- const { flamegraphHint } = useParcaContext();
21
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full items-center justify-end gap-2 pb-2", children: [_jsxs("div", { className: cx('flex w-full justify-between flex-col-reverse md:flex-row', isMultiPanelView && dashboardItem === 'flamegraph' ? 'items-end gap-x-2' : 'items-end'), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: cx(isMultiPanelView ? '' : 'hidden', 'flex items-center'), ...dragHandleProps, children: _jsx(Icon, { className: "text-xl", icon: "material-symbols:drag-indicator" }) }), isMultiPanelView ? (_jsx("div", { className: "flex gap-2", children: actionButtons[dashboardItem] })) : null] }), _jsx("div", { className: cx('flex flex-row items-center gap-4', isMultiPanelView && dashboardItem === 'flamegraph' && 'pb-[10px]'), children: dashboardItem === 'flamegraph' && flamegraphHint != null ? (_jsx("div", { className: "px-2", children: flamegraphHint })) : null })] }), isMultiPanelView && (_jsx(IconButton, { className: "py-0", onClick: () => handleClosePanel(dashboardItem), icon: _jsx(CloseIcon, {}) }))] }), getDashboardItemByType({
22
- type: dashboardItem,
23
- isHalfScreen: isMultiPanelView,
24
- })] }));
25
- });
26
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
27
+ export var VisualizationPanel = /*#__PURE__*/React.memo(function VisualizationPanel(t0) {
28
+ var $ = _c(41);
29
+ var dashboardItem = t0.dashboardItem,
30
+ isMultiPanelView = t0.isMultiPanelView,
31
+ handleClosePanel = t0.handleClosePanel,
32
+ dragHandleProps = t0.dragHandleProps,
33
+ getDashboardItemByType = t0.getDashboardItemByType,
34
+ actionButtons = t0.actionButtons;
35
+ var _useParcaContext = useParcaContext(),
36
+ flamegraphHint = _useParcaContext.flamegraphHint;
37
+ var t1 = isMultiPanelView && dashboardItem === "flamegraph" ? "items-end gap-x-2" : "items-end";
38
+ var t2;
39
+ if ($[0] !== t1) {
40
+ t2 = cx("flex w-full justify-between flex-col-reverse md:flex-row", t1);
41
+ $[0] = t1;
42
+ $[1] = t2;
43
+ } else {
44
+ t2 = $[1];
45
+ }
46
+ var t3 = isMultiPanelView ? "" : "hidden";
47
+ var t4;
48
+ if ($[2] !== t3) {
49
+ t4 = cx(t3, "flex items-center");
50
+ $[2] = t3;
51
+ $[3] = t4;
52
+ } else {
53
+ t4 = $[3];
54
+ }
55
+ var t5;
56
+ if ($[4] === Symbol["for"]("react.memo_cache_sentinel")) {
57
+ t5 = /*#__PURE__*/_jsx(Icon, {
58
+ className: "text-xl",
59
+ icon: "material-symbols:drag-indicator"
60
+ });
61
+ $[4] = t5;
62
+ } else {
63
+ t5 = $[4];
64
+ }
65
+ var t6;
66
+ if ($[5] !== dragHandleProps || $[6] !== t4) {
67
+ t6 = /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
68
+ className: t4
69
+ }, dragHandleProps), {}, {
70
+ children: t5
71
+ }));
72
+ $[5] = dragHandleProps;
73
+ $[6] = t4;
74
+ $[7] = t6;
75
+ } else {
76
+ t6 = $[7];
77
+ }
78
+ var t7;
79
+ if ($[8] !== actionButtons || $[9] !== dashboardItem || $[10] !== isMultiPanelView) {
80
+ t7 = isMultiPanelView ? /*#__PURE__*/_jsx("div", {
81
+ className: "flex gap-2",
82
+ children: actionButtons[dashboardItem]
83
+ }) : null;
84
+ $[8] = actionButtons;
85
+ $[9] = dashboardItem;
86
+ $[10] = isMultiPanelView;
87
+ $[11] = t7;
88
+ } else {
89
+ t7 = $[11];
90
+ }
91
+ var t8;
92
+ if ($[12] !== t6 || $[13] !== t7) {
93
+ t8 = /*#__PURE__*/_jsxs("div", {
94
+ className: "flex items-center gap-2",
95
+ children: [t6, t7]
96
+ });
97
+ $[12] = t6;
98
+ $[13] = t7;
99
+ $[14] = t8;
100
+ } else {
101
+ t8 = $[14];
102
+ }
103
+ var t9 = isMultiPanelView && dashboardItem === "flamegraph" && "pb-[10px]";
104
+ var t10;
105
+ if ($[15] !== t9) {
106
+ t10 = cx("flex flex-row items-center gap-4", t9);
107
+ $[15] = t9;
108
+ $[16] = t10;
109
+ } else {
110
+ t10 = $[16];
111
+ }
112
+ var t11;
113
+ if ($[17] !== dashboardItem || $[18] !== flamegraphHint) {
114
+ t11 = dashboardItem === "flamegraph" && flamegraphHint != null ? /*#__PURE__*/_jsx("div", {
115
+ className: "px-2",
116
+ children: flamegraphHint
117
+ }) : null;
118
+ $[17] = dashboardItem;
119
+ $[18] = flamegraphHint;
120
+ $[19] = t11;
121
+ } else {
122
+ t11 = $[19];
123
+ }
124
+ var t12;
125
+ if ($[20] !== t10 || $[21] !== t11) {
126
+ t12 = /*#__PURE__*/_jsx("div", {
127
+ className: t10,
128
+ children: t11
129
+ });
130
+ $[20] = t10;
131
+ $[21] = t11;
132
+ $[22] = t12;
133
+ } else {
134
+ t12 = $[22];
135
+ }
136
+ var t13;
137
+ if ($[23] !== t12 || $[24] !== t2 || $[25] !== t8) {
138
+ t13 = /*#__PURE__*/_jsxs("div", {
139
+ className: t2,
140
+ children: [t8, t12]
141
+ });
142
+ $[23] = t12;
143
+ $[24] = t2;
144
+ $[25] = t8;
145
+ $[26] = t13;
146
+ } else {
147
+ t13 = $[26];
148
+ }
149
+ var t14;
150
+ if ($[27] !== dashboardItem || $[28] !== handleClosePanel || $[29] !== isMultiPanelView) {
151
+ t14 = isMultiPanelView && /*#__PURE__*/_jsx(IconButton, {
152
+ className: "py-0",
153
+ onClick: function onClick() {
154
+ return handleClosePanel(dashboardItem);
155
+ },
156
+ icon: /*#__PURE__*/_jsx(CloseIcon, {})
157
+ });
158
+ $[27] = dashboardItem;
159
+ $[28] = handleClosePanel;
160
+ $[29] = isMultiPanelView;
161
+ $[30] = t14;
162
+ } else {
163
+ t14 = $[30];
164
+ }
165
+ var t15;
166
+ if ($[31] !== t13 || $[32] !== t14) {
167
+ t15 = /*#__PURE__*/_jsxs("div", {
168
+ className: "flex w-full items-center justify-end gap-2 pb-2",
169
+ children: [t13, t14]
170
+ });
171
+ $[31] = t13;
172
+ $[32] = t14;
173
+ $[33] = t15;
174
+ } else {
175
+ t15 = $[33];
176
+ }
177
+ var t16;
178
+ if ($[34] !== dashboardItem || $[35] !== getDashboardItemByType || $[36] !== isMultiPanelView) {
179
+ t16 = getDashboardItemByType({
180
+ type: dashboardItem,
181
+ isHalfScreen: isMultiPanelView
182
+ });
183
+ $[34] = dashboardItem;
184
+ $[35] = getDashboardItemByType;
185
+ $[36] = isMultiPanelView;
186
+ $[37] = t16;
187
+ } else {
188
+ t16 = $[37];
189
+ }
190
+ var t17;
191
+ if ($[38] !== t15 || $[39] !== t16) {
192
+ t17 = /*#__PURE__*/_jsxs(_Fragment, {
193
+ children: [t15, t16]
194
+ });
195
+ $[38] = t15;
196
+ $[39] = t16;
197
+ $[40] = t17;
198
+ } else {
199
+ t17 = $[40];
200
+ }
201
+ return t17;
202
+ });
@@ -1,4 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
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,34 +17,84 @@ 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 { createContext, useContext } from 'react';
15
22
  import { useURLState } from '@parca/components';
16
- const DashboardContext = createContext(undefined);
17
- export const DashboardProvider = ({ children }) => {
18
- const [dashboardItems, setDashboardItems] = useURLState('dashboard_items', {
19
- alwaysReturnArray: true,
20
- });
21
- const [, setSandwichFunctionName] = useURLState('sandwich_function_name');
22
- const handleClosePanel = (visualizationType) => {
23
- const newDashboardItems = dashboardItems.filter(item => item !== visualizationType);
24
- setDashboardItems(newDashboardItems);
25
- // Reset sandwich function name when closing sandwich panel
26
- if (visualizationType === 'sandwich') {
27
- setSandwichFunctionName(undefined);
28
- }
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ var DashboardContext = /*#__PURE__*/createContext(undefined);
25
+ export var DashboardProvider = function DashboardProvider(t0) {
26
+ var $ = _c(13);
27
+ var children = t0.children;
28
+ var t1;
29
+ if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
30
+ t1 = {
31
+ alwaysReturnArray: true
29
32
  };
30
- const isMultiPanelView = dashboardItems.length > 1;
31
- return (_jsx(DashboardContext.Provider, { value: {
32
- dashboardItems,
33
- setDashboardItems,
34
- handleClosePanel,
35
- isMultiPanelView,
36
- }, children: children }));
37
- };
38
- export const useDashboard = () => {
39
- const context = useContext(DashboardContext);
40
- if (context === undefined) {
41
- throw new Error('useDashboard must be used within a DashboardProvider');
42
- }
43
- return context;
33
+ $[0] = t1;
34
+ } else {
35
+ t1 = $[0];
36
+ }
37
+ var _useURLState = useURLState("dashboard_items", t1),
38
+ _useURLState2 = _slicedToArray(_useURLState, 2),
39
+ dashboardItems = _useURLState2[0],
40
+ setDashboardItems = _useURLState2[1];
41
+ var _useURLState3 = useURLState("sandwich_function_name"),
42
+ _useURLState4 = _slicedToArray(_useURLState3, 2),
43
+ setSandwichFunctionName = _useURLState4[1];
44
+ var t2;
45
+ if ($[1] !== dashboardItems || $[2] !== setDashboardItems || $[3] !== setSandwichFunctionName) {
46
+ t2 = function t2(visualizationType) {
47
+ var newDashboardItems = dashboardItems.filter(function (item) {
48
+ return item !== visualizationType;
49
+ });
50
+ setDashboardItems(newDashboardItems);
51
+ if (visualizationType === "sandwich") {
52
+ setSandwichFunctionName(undefined);
53
+ }
54
+ };
55
+ $[1] = dashboardItems;
56
+ $[2] = setDashboardItems;
57
+ $[3] = setSandwichFunctionName;
58
+ $[4] = t2;
59
+ } else {
60
+ t2 = $[4];
61
+ }
62
+ var handleClosePanel = t2;
63
+ var isMultiPanelView = dashboardItems.length > 1;
64
+ var t3;
65
+ if ($[5] !== dashboardItems || $[6] !== handleClosePanel || $[7] !== isMultiPanelView || $[8] !== setDashboardItems) {
66
+ t3 = {
67
+ dashboardItems: dashboardItems,
68
+ setDashboardItems: setDashboardItems,
69
+ handleClosePanel: handleClosePanel,
70
+ isMultiPanelView: isMultiPanelView
71
+ };
72
+ $[5] = dashboardItems;
73
+ $[6] = handleClosePanel;
74
+ $[7] = isMultiPanelView;
75
+ $[8] = setDashboardItems;
76
+ $[9] = t3;
77
+ } else {
78
+ t3 = $[9];
79
+ }
80
+ var t4;
81
+ if ($[10] !== children || $[11] !== t3) {
82
+ t4 = /*#__PURE__*/_jsx(DashboardContext.Provider, {
83
+ value: t3,
84
+ children: children
85
+ });
86
+ $[10] = children;
87
+ $[11] = t3;
88
+ $[12] = t4;
89
+ } else {
90
+ t4 = $[12];
91
+ }
92
+ return t4;
44
93
  };
94
+ export var useDashboard = function useDashboard() {
95
+ var context = useContext(DashboardContext);
96
+ if (context === undefined) {
97
+ throw new Error("useDashboard must be used within a DashboardProvider");
98
+ }
99
+ return context;
100
+ };
@@ -1,4 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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,21 +17,56 @@ 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 { createContext, useContext } from 'react';
15
- export const defaultValue = {
16
- profileSource: undefined,
17
- compareMode: false,
18
- timelineGuide: { show: false },
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
+ export var defaultValue = {
24
+ profileSource: undefined,
25
+ compareMode: false,
26
+ timelineGuide: {
27
+ show: false
28
+ }
19
29
  };
20
- const ProfileViewContext = createContext(defaultValue);
21
- export const ProfileViewContextProvider = ({ children, value, }) => {
22
- return (_jsx(ProfileViewContext.Provider, { value: { ...defaultValue, ...(value ?? {}) }, children: children }));
30
+ var ProfileViewContext = /*#__PURE__*/createContext(defaultValue);
31
+ export var ProfileViewContextProvider = function ProfileViewContextProvider(t0) {
32
+ var $ = _c(7);
33
+ var children = t0.children,
34
+ value = t0.value;
35
+ var t1;
36
+ if ($[0] !== value) {
37
+ t1 = value !== null && value !== void 0 ? value : {};
38
+ $[0] = value;
39
+ $[1] = t1;
40
+ } else {
41
+ t1 = $[1];
42
+ }
43
+ var t2;
44
+ if ($[2] !== t1) {
45
+ t2 = _objectSpread(_objectSpread({}, defaultValue), t1);
46
+ $[2] = t1;
47
+ $[3] = t2;
48
+ } else {
49
+ t2 = $[3];
50
+ }
51
+ var t3;
52
+ if ($[4] !== children || $[5] !== t2) {
53
+ t3 = /*#__PURE__*/_jsx(ProfileViewContext.Provider, {
54
+ value: t2,
55
+ children: children
56
+ });
57
+ $[4] = children;
58
+ $[5] = t2;
59
+ $[6] = t3;
60
+ } else {
61
+ t3 = $[6];
62
+ }
63
+ return t3;
23
64
  };
24
- export const useProfileViewContext = () => {
25
- const context = useContext(ProfileViewContext);
26
- if (context == null) {
27
- return defaultValue;
28
- }
29
- return context;
65
+ export var useProfileViewContext = function useProfileViewContext() {
66
+ var context = useContext(ProfileViewContext);
67
+ if (context == null) {
68
+ return defaultValue;
69
+ }
70
+ return context;
30
71
  };
31
- export default ProfileViewContext;
72
+ export default ProfileViewContext;
@@ -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,24 +11,26 @@
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 { useEffect, useRef } from 'react';
14
16
  import { wellKnownProfiles } from '../../ProfileTypeSelector';
15
- const CPU_PREFERRED_DIMENSIONS = ['cpu', 'cpuid', 'thread', 'thread_id'];
16
- const GPU_DIMENSIONS = ['node', 'gpu', 'stream'];
17
- const getWellKnownProfileName = (profileType) => {
18
- if (profileType == null)
19
- return undefined;
20
- const key = profileType.toString();
21
- return wellKnownProfiles[key]?.name;
17
+ var CPU_PREFERRED_DIMENSIONS = ['cpu', 'cpuid', 'thread', 'thread_id'];
18
+ var GPU_DIMENSIONS = ['node', 'gpu', 'stream'];
19
+ var getWellKnownProfileName = function getWellKnownProfileName(profileType) {
20
+ var _wellKnownProfiles$ke;
21
+ if (profileType == null) return undefined;
22
+ var key = profileType.toString();
23
+ return (_wellKnownProfiles$ke = wellKnownProfiles[key]) === null || _wellKnownProfiles$ke === void 0 ? void 0 : _wellKnownProfiles$ke.name;
22
24
  };
23
- const isOnGpuProfile = (profileType) => {
24
- const wellKnownName = getWellKnownProfileName(profileType);
25
- return wellKnownName === 'On-GPU';
25
+ var isOnGpuProfile = function isOnGpuProfile(profileType) {
26
+ var wellKnownName = getWellKnownProfileName(profileType);
27
+ return wellKnownName === 'On-GPU';
26
28
  };
27
- const isOnCpuProfile = (profileType) => {
28
- const wellKnownName = getWellKnownProfileName(profileType);
29
- return wellKnownName === 'On-CPU';
29
+ var isOnCpuProfile = function isOnCpuProfile(profileType) {
30
+ var wellKnownName = getWellKnownProfileName(profileType);
31
+ return wellKnownName === 'On-CPU';
30
32
  };
33
+
31
34
  /**
32
35
  * Auto-selects the best flamechart "group by" dimension on first load.
33
36
  *
@@ -41,35 +44,62 @@ const isOnCpuProfile = (profileType) => {
41
44
  * For all other profile types:
42
45
  * - No auto-selection
43
46
  */
44
- export const useAutoSelectDimension = (metadataLabels, flamechartDimension, setFlamechartDimension, profileType) => {
45
- const hasAutoSelected = useRef(false);
46
- useEffect(() => {
47
- if (hasAutoSelected.current)
48
- return;
49
- if (metadataLabels == null || metadataLabels.length === 0)
50
- return;
51
- if ((flamechartDimension ?? []).length > 0) {
47
+ export var useAutoSelectDimension = function useAutoSelectDimension(metadataLabels, flamechartDimension, setFlamechartDimension, profileType) {
48
+ var $ = _c(6);
49
+ var hasAutoSelected = useRef(false);
50
+ var t0;
51
+ var t1;
52
+ if ($[0] !== flamechartDimension || $[1] !== metadataLabels || $[2] !== profileType || $[3] !== setFlamechartDimension) {
53
+ t0 = function t0() {
54
+ if (hasAutoSelected.current) {
55
+ return;
56
+ }
57
+ if (metadataLabels == null || metadataLabels.length === 0) {
58
+ return;
59
+ }
60
+ if ((flamechartDimension !== null && flamechartDimension !== void 0 ? flamechartDimension : []).length > 0) {
61
+ hasAutoSelected.current = true;
62
+ return;
63
+ }
64
+ if (isOnGpuProfile(profileType)) {
65
+ var availableGpuDims = GPU_DIMENSIONS.filter(function (d) {
66
+ return metadataLabels.includes(d);
67
+ });
68
+ if (availableGpuDims.length > 0) {
69
+ setFlamechartDimension(availableGpuDims.map(_temp));
70
+ hasAutoSelected.current = true;
71
+ return;
72
+ }
73
+ }
74
+ if (isOnCpuProfile(profileType)) {
75
+ var hasNode = metadataLabels.includes("node");
76
+ for (var _i = 0, _CPU_PREFERRED_DIMENS = CPU_PREFERRED_DIMENSIONS; _i < _CPU_PREFERRED_DIMENS.length; _i++) {
77
+ var name = _CPU_PREFERRED_DIMENS[_i];
78
+ if (metadataLabels.includes(name)) {
79
+ var dims = hasNode ? ["node", name] : [name];
80
+ setFlamechartDimension(dims.map(_temp2));
52
81
  hasAutoSelected.current = true;
53
82
  return;
83
+ }
54
84
  }
55
- if (isOnGpuProfile(profileType)) {
56
- const availableGpuDims = GPU_DIMENSIONS.filter(d => metadataLabels.includes(d));
57
- if (availableGpuDims.length > 0) {
58
- setFlamechartDimension(availableGpuDims.map(d => `labels.${d}`));
59
- hasAutoSelected.current = true;
60
- return;
61
- }
62
- }
63
- if (isOnCpuProfile(profileType)) {
64
- const hasNode = metadataLabels.includes('node');
65
- for (const name of CPU_PREFERRED_DIMENSIONS) {
66
- if (metadataLabels.includes(name)) {
67
- const dims = hasNode ? ['node', name] : [name];
68
- setFlamechartDimension(dims.map(d => `labels.${d}`));
69
- hasAutoSelected.current = true;
70
- return;
71
- }
72
- }
73
- }
74
- }, [metadataLabels, flamechartDimension, setFlamechartDimension, profileType]);
85
+ }
86
+ };
87
+ t1 = [metadataLabels, flamechartDimension, setFlamechartDimension, profileType];
88
+ $[0] = flamechartDimension;
89
+ $[1] = metadataLabels;
90
+ $[2] = profileType;
91
+ $[3] = setFlamechartDimension;
92
+ $[4] = t0;
93
+ $[5] = t1;
94
+ } else {
95
+ t0 = $[4];
96
+ t1 = $[5];
97
+ }
98
+ useEffect(t0, t1);
75
99
  };
100
+ function _temp(d_0) {
101
+ return "labels.".concat(d_0);
102
+ }
103
+ function _temp2(d_1) {
104
+ return "labels.".concat(d_1);
105
+ }