@parca/profile 0.19.140 → 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 (253) hide show
  1. package/CHANGELOG.md +5 -1
  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.d.ts.map +1 -1
  9. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +104 -72
  10. package/dist/MatchersInput/SuggestionItem.js +91 -12
  11. package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
  12. package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
  13. package/dist/MatchersInput/SuggestionsList.js +371 -157
  14. package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
  15. package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
  16. package/dist/MatchersInput/index.js +308 -115
  17. package/dist/MetricsCircle/index.js +39 -3
  18. package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
  19. package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
  20. package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
  21. package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
  22. package/dist/MetricsGraph/index.js +552 -203
  23. package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
  24. package/dist/MetricsGraph/utils/colorMapping.js +24 -17
  25. package/dist/MetricsSeries/index.js +70 -7
  26. package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
  27. package/dist/PreSelectedMatchers/index.js +249 -102
  28. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  29. package/dist/ProfileExplorer/ProfileExplorerCompare.js +241 -45
  30. package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
  31. package/dist/ProfileExplorer/index.js +183 -32
  32. package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
  33. package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
  34. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
  35. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
  36. package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
  37. package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
  38. package/dist/ProfileFlameChart/index.d.ts.map +1 -1
  39. package/dist/ProfileFlameChart/index.js +267 -129
  40. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
  41. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +288 -89
  42. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
  43. package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
  44. package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
  45. package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
  46. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  47. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +72 -47
  48. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
  49. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
  50. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
  51. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
  52. package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
  53. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
  54. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
  55. package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
  56. package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
  57. package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
  58. package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
  59. package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
  60. package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
  61. package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
  62. package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
  63. package/dist/ProfileFlameGraph/index.js +324 -150
  64. package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
  65. package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
  66. package/dist/ProfileMetricsGraph/index.js +519 -258
  67. package/dist/ProfileSelector/CompareButton.js +132 -12
  68. package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
  69. package/dist/ProfileSelector/MetricsGraphSection.js +236 -64
  70. package/dist/ProfileSelector/index.d.ts.map +1 -1
  71. package/dist/ProfileSelector/index.js +727 -141
  72. package/dist/ProfileSelector/useAutoQuerySelector.js +249 -130
  73. package/dist/ProfileSource.js +230 -163
  74. package/dist/ProfileTypeSelector/index.js +214 -125
  75. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
  76. package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
  77. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +141 -35
  78. package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
  79. package/dist/ProfileView/components/ColorStackLegend.js +185 -55
  80. package/dist/ProfileView/components/DashboardItems/index.js +87 -28
  81. package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
  82. package/dist/ProfileView/components/DiffLegend.js +172 -29
  83. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
  84. package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
  85. package/dist/ProfileView/components/InvertCallStack/index.js +100 -12
  86. package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
  87. package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
  88. package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
  89. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +2 -1
  90. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
  91. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +188 -118
  92. package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
  93. package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
  94. package/dist/ProfileView/components/ShareButton/index.js +352 -62
  95. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  96. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +678 -194
  97. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
  98. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
  99. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +199 -157
  100. package/dist/ProfileView/components/Toolbars/index.d.ts +2 -2
  101. package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
  102. package/dist/ProfileView/components/Toolbars/index.js +441 -21
  103. package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
  104. package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
  105. package/dist/ProfileView/components/ViewSelector/index.js +212 -86
  106. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
  107. package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
  108. package/dist/ProfileView/components/VisualizationPanel.js +185 -8
  109. package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
  110. package/dist/ProfileView/context/DashboardContext.js +85 -29
  111. package/dist/ProfileView/context/ProfileViewContext.js +56 -15
  112. package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
  113. package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
  114. package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
  115. package/dist/ProfileView/hooks/useResetFlameGraphState.js +32 -12
  116. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
  117. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
  118. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
  119. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +40 -19
  120. package/dist/ProfileView/hooks/useVisualizationState.d.ts +3 -3
  121. package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
  122. package/dist/ProfileView/hooks/useVisualizationState.js +258 -67
  123. package/dist/ProfileView/index.js +383 -45
  124. package/dist/ProfileView/types/visualization.js +1 -13
  125. package/dist/ProfileView/utils/colorUtils.js +8 -7
  126. package/dist/ProfileViewWithData.d.ts.map +1 -1
  127. package/dist/ProfileViewWithData.js +332 -228
  128. package/dist/QueryControls/index.js +418 -47
  129. package/dist/Sandwich/components/CalleesSection.js +54 -4
  130. package/dist/Sandwich/components/CallersSection.js +97 -27
  131. package/dist/Sandwich/components/TableSection.js +77 -4
  132. package/dist/Sandwich/index.d.ts.map +1 -1
  133. package/dist/Sandwich/index.js +126 -14
  134. package/dist/Sandwich/utils/processRowData.js +48 -39
  135. package/dist/SelectWithRefresh/index.js +102 -28
  136. package/dist/SimpleMatchers/Select.js +520 -187
  137. package/dist/SimpleMatchers/index.js +590 -288
  138. package/dist/SourceView/Highlighter.js +230 -70
  139. package/dist/SourceView/LineNo.js +72 -17
  140. package/dist/SourceView/index.d.ts.map +1 -1
  141. package/dist/SourceView/index.js +178 -104
  142. package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
  143. package/dist/SourceView/lang-detector/index.js +28 -14
  144. package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
  145. package/dist/SourceView/useSelectedLineRange.js +99 -23
  146. package/dist/Table/ColorCell.js +42 -1
  147. package/dist/Table/ColumnsVisibility.js +114 -6
  148. package/dist/Table/MoreDropdown.d.ts.map +1 -1
  149. package/dist/Table/MoreDropdown.js +122 -25
  150. package/dist/Table/TableContextMenu.d.ts.map +1 -1
  151. package/dist/Table/TableContextMenu.js +151 -137
  152. package/dist/Table/TableContextMenuWrapper.js +59 -14
  153. package/dist/Table/hooks/useColorManagement.js +58 -16
  154. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  155. package/dist/Table/hooks/useTableConfiguration.js +333 -169
  156. package/dist/Table/index.d.ts.map +1 -1
  157. package/dist/Table/index.js +222 -128
  158. package/dist/Table/utils/functions.js +169 -144
  159. package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
  160. package/dist/TimelineGuide/index.js +209 -16
  161. package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
  162. package/dist/TopTable/index.d.ts.map +1 -1
  163. package/dist/TopTable/index.js +342 -123
  164. package/dist/contexts/LabelsQueryProvider.js +94 -32
  165. package/dist/contexts/UnifiedLabelsContext.js +114 -49
  166. package/dist/contexts/utils.js +37 -15
  167. package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
  168. package/dist/hooks/useCompareModeMeta.js +158 -64
  169. package/dist/hooks/useLabels.js +295 -52
  170. package/dist/hooks/useQueryState.d.ts +3 -3
  171. package/dist/hooks/useQueryState.d.ts.map +1 -1
  172. package/dist/hooks/useQueryState.js +373 -332
  173. package/dist/index.d.ts +2 -3
  174. package/dist/index.d.ts.map +1 -1
  175. package/dist/index.js +22 -8
  176. package/dist/testdata/fg-diff.json +3750 -0
  177. package/dist/testdata/fg-simple.json +1879 -0
  178. package/dist/testdata/link_data.json +56 -0
  179. package/dist/testdata/tabular.json +30 -0
  180. package/dist/testdata/test_flamegraph.json +26846 -0
  181. package/dist/testdata/test_graph.json +53 -0
  182. package/dist/useDelayedLoader.js +32 -18
  183. package/dist/useGrpcQuery/index.js +71 -11
  184. package/dist/useHasProfileData.js +90 -12
  185. package/dist/useQuery.js +205 -64
  186. package/dist/useSumBy.d.ts +1 -1
  187. package/dist/useSumBy.d.ts.map +1 -1
  188. package/dist/useSumBy.js +294 -138
  189. package/dist/utils.js +62 -30
  190. package/package.json +9 -10
  191. package/src/GraphTooltipArrow/index.tsx +3 -0
  192. package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +13 -11
  193. package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
  194. package/src/MatchersInput/SuggestionsList.tsx +11 -10
  195. package/src/MatchersInput/index.tsx +1 -1
  196. package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
  197. package/src/PreSelectedMatchers/index.tsx +3 -0
  198. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -4
  199. package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
  200. package/src/ProfileFlameChart/index.tsx +28 -21
  201. package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +9 -10
  202. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +6 -5
  203. package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
  204. package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
  205. package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
  206. package/src/ProfileFlameGraph/index.tsx +9 -6
  207. package/src/ProfileMetricsGraph/index.tsx +8 -6
  208. package/src/ProfileSelector/MetricsGraphSection.tsx +10 -5
  209. package/src/ProfileSelector/index.tsx +61 -39
  210. package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +6 -10
  211. package/src/ProfileView/components/ColorStackLegend.tsx +4 -2
  212. package/src/ProfileView/components/InvertCallStack/index.tsx +4 -5
  213. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +192 -94
  214. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
  215. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +28 -24
  216. package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +5 -4
  217. package/src/ProfileView/components/Toolbars/index.tsx +3 -3
  218. package/src/ProfileView/components/ViewSelector/index.tsx +16 -9
  219. package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
  220. package/src/ProfileView/context/DashboardContext.tsx +6 -6
  221. package/src/ProfileView/hooks/useResetFlameGraphState.ts +4 -6
  222. package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +26 -24
  223. package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +8 -16
  224. package/src/ProfileView/hooks/useVisualizationState.ts +69 -61
  225. package/src/ProfileViewWithData.tsx +35 -29
  226. package/src/Sandwich/index.tsx +3 -4
  227. package/src/SourceView/index.tsx +2 -4
  228. package/src/SourceView/useSelectedLineRange.ts +19 -34
  229. package/src/Table/MoreDropdown.tsx +11 -9
  230. package/src/Table/TableContextMenu.tsx +13 -10
  231. package/src/Table/hooks/useTableConfiguration.tsx +11 -16
  232. package/src/Table/index.tsx +21 -12
  233. package/src/TopTable/index.tsx +4 -3
  234. package/src/hooks/useCompareModeMeta.ts +91 -61
  235. package/src/hooks/useQueryState.test.tsx +345 -275
  236. package/src/hooks/useQueryState.ts +118 -136
  237. package/src/index.tsx +15 -16
  238. package/src/useDelayedLoader.ts +10 -10
  239. package/src/useSumBy.ts +15 -21
  240. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
  241. package/dist/hooks/urlParsers.d.ts +0 -18
  242. package/dist/hooks/urlParsers.d.ts.map +0 -1
  243. package/dist/hooks/urlParsers.js +0 -32
  244. package/dist/hooks/useColorBy.d.ts +0 -5
  245. package/dist/hooks/useColorBy.d.ts.map +0 -1
  246. package/dist/hooks/useColorBy.js +0 -26
  247. package/dist/hooks/useDashboardItems.d.ts +0 -5
  248. package/dist/hooks/useDashboardItems.d.ts.map +0 -1
  249. package/dist/hooks/useDashboardItems.js +0 -27
  250. package/dist/hooks/useQueryState.test.js +0 -868
  251. package/src/hooks/urlParsers.ts +0 -38
  252. package/src/hooks/useColorBy.ts +0 -42
  253. package/src/hooks/useDashboardItems.ts +0 -46
@@ -1,4 +1,21 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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"; // 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.
2
19
  import { Icon } from '@iconify/react';
3
20
  import { Button, useParcaContext } from '@parca/components';
4
21
  import { TEST_IDS, testId } from '@parca/test-utils';
@@ -10,30 +27,433 @@ import ShareButton from '../ShareButton';
10
27
  import ViewSelector from '../ViewSelector';
11
28
  import MultiLevelDropdown from './MultiLevelDropdown';
12
29
  import TableColumnsDropdown from './TableColumnsDropdown';
13
- export const TableToolbar = ({ profileType, total, filtered }) => {
14
- return (_jsx(_Fragment, { children: _jsx("div", { className: "flex w-full gap-2 items-end", children: _jsx(TableColumnsDropdown, { profileType: profileType, total: total, filtered: filtered }) }) }));
30
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
31
+ export var TableToolbar = function TableToolbar(t0) {
32
+ var $ = _c(4);
33
+ var profileType = t0.profileType,
34
+ total = t0.total,
35
+ filtered = t0.filtered;
36
+ var t1;
37
+ if ($[0] !== filtered || $[1] !== profileType || $[2] !== total) {
38
+ t1 = /*#__PURE__*/_jsx(_Fragment, {
39
+ children: /*#__PURE__*/_jsx("div", {
40
+ className: "flex w-full gap-2 items-end",
41
+ children: /*#__PURE__*/_jsx(TableColumnsDropdown, {
42
+ profileType: profileType,
43
+ total: total,
44
+ filtered: filtered
45
+ })
46
+ })
47
+ });
48
+ $[0] = filtered;
49
+ $[1] = profileType;
50
+ $[2] = total;
51
+ $[3] = t1;
52
+ } else {
53
+ t1 = $[3];
54
+ }
55
+ return t1;
56
+ };
57
+ export var FlameGraphToolbar = function FlameGraphToolbar(t0) {
58
+ var $ = _c(7);
59
+ var curPath = t0.curPath,
60
+ setNewCurPath = t0.setNewCurPath;
61
+ var t1;
62
+ if ($[0] !== setNewCurPath) {
63
+ t1 = function t1() {
64
+ return setNewCurPath([]);
65
+ };
66
+ $[0] = setNewCurPath;
67
+ $[1] = t1;
68
+ } else {
69
+ t1 = $[1];
70
+ }
71
+ var t2 = curPath.length === 0;
72
+ var t3;
73
+ if ($[2] === Symbol["for"]("react.memo_cache_sentinel")) {
74
+ t3 = testId(TEST_IDS.FLAMEGRAPH_RESET_BUTTON);
75
+ $[2] = t3;
76
+ } else {
77
+ t3 = $[2];
78
+ }
79
+ var t4;
80
+ if ($[3] === Symbol["for"]("react.memo_cache_sentinel")) {
81
+ t4 = /*#__PURE__*/_jsx(Icon, {
82
+ icon: "system-uicons:reset",
83
+ width: 20
84
+ });
85
+ $[3] = t4;
86
+ } else {
87
+ t4 = $[3];
88
+ }
89
+ var t5;
90
+ if ($[4] !== t1 || $[5] !== t2) {
91
+ t5 = /*#__PURE__*/_jsx(_Fragment, {
92
+ children: /*#__PURE__*/_jsx("div", {
93
+ className: "flex w-full gap-2 items-end",
94
+ children: /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({
95
+ variant: "neutral",
96
+ className: "gap-2 w-max h-fit",
97
+ onClick: t1,
98
+ disabled: t2,
99
+ id: "h-reset-graph"
100
+ }, t3), {}, {
101
+ children: ["Reset graph", t4]
102
+ }))
103
+ })
104
+ });
105
+ $[4] = t1;
106
+ $[5] = t2;
107
+ $[6] = t5;
108
+ } else {
109
+ t5 = $[6];
110
+ }
111
+ return t5;
15
112
  };
16
- export const FlameGraphToolbar = ({ curPath, setNewCurPath }) => {
17
- return (_jsx(_Fragment, { children: _jsx("div", { className: "flex w-full gap-2 items-end", children: _jsxs(Button, { variant: "neutral", className: "gap-2 w-max h-fit", onClick: () => setNewCurPath([]), disabled: curPath.length === 0, id: "h-reset-graph", ...testId(TEST_IDS.FLAMEGRAPH_RESET_BUTTON), children: ["Reset graph", _jsx(Icon, { icon: "system-uicons:reset", width: 20 })] }) }) }));
113
+ export var SandwichFlameGraphToolbar = function SandwichFlameGraphToolbar(t0) {
114
+ var $ = _c(5);
115
+ var resetSandwichFunctionName = t0.resetSandwichFunctionName,
116
+ sandwichFunctionName = t0.sandwichFunctionName;
117
+ var t1;
118
+ if ($[0] !== resetSandwichFunctionName) {
119
+ t1 = function t1() {
120
+ return resetSandwichFunctionName();
121
+ };
122
+ $[0] = resetSandwichFunctionName;
123
+ $[1] = t1;
124
+ } else {
125
+ t1 = $[1];
126
+ }
127
+ var t2 = sandwichFunctionName === undefined || sandwichFunctionName.length === 0;
128
+ var t3;
129
+ if ($[2] !== t1 || $[3] !== t2) {
130
+ t3 = /*#__PURE__*/_jsx(_Fragment, {
131
+ children: /*#__PURE__*/_jsx("div", {
132
+ className: "flex w-full gap-2 items-end justify-between",
133
+ children: /*#__PURE__*/_jsx(Button, {
134
+ color: "neutral",
135
+ onClick: t1,
136
+ className: "w-auto",
137
+ variant: "neutral",
138
+ disabled: t2,
139
+ children: "Reset view"
140
+ })
141
+ })
142
+ });
143
+ $[2] = t1;
144
+ $[3] = t2;
145
+ $[4] = t3;
146
+ } else {
147
+ t3 = $[4];
148
+ }
149
+ return t3;
18
150
  };
19
- export const SandwichFlameGraphToolbar = ({ resetSandwichFunctionName, sandwichFunctionName, }) => {
20
- 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 == null || sandwichFunctionName.length === 0, children: "Reset view" }) }) }));
151
+ var Divider = function Divider() {
152
+ var $ = _c(1);
153
+ var t0;
154
+ if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
155
+ t0 = /*#__PURE__*/_jsx("div", {
156
+ className: "border-t mt-4 border-gray-200 dark:border-gray-700 h-[1px] w-full pb-4"
157
+ });
158
+ $[0] = t0;
159
+ } else {
160
+ t0 = $[0];
161
+ }
162
+ return t0;
21
163
  };
22
- const Divider = () => (_jsx("div", { className: "border-t mt-4 border-gray-200 dark:border-gray-700 h-[1px] w-full pb-4" }));
23
- export const VisualisationToolbar = ({ groupBy, toggleGroupBy, setGroupByLabels, flamechartDimension, setFlamechartDimension, profileType, profileSource, queryClient, onDownloadPProf, pprofdownloading, profileViewExternalSubActions, curPath, setNewCurPath, total, filtered, showVisualizationSelector = true, alignFunctionName, setAlignFunctionName, colorBy, setColorBy, metadata: { labels: groupByLabels, refetch: metadataRefetch, loading: metadataLoading }, }) => {
24
- const { dashboardItems } = useDashboard();
25
- const isTableViz = dashboardItems?.includes('table');
26
- const isTableVizOnly = dashboardItems?.length === 1 && isTableViz;
27
- const isGraphViz = dashboardItems?.includes('flamegraph');
28
- const isGraphVizOnly = dashboardItems?.length === 1 && isGraphViz;
29
- const isFlamechartViz = dashboardItems?.includes('flamechart');
30
- const isFlamechartVizOnly = dashboardItems?.length === 1 && isFlamechartViz;
31
- const { enableFlamechartFiltering } = useParcaContext();
32
- const req = profileSource?.QueryRequest();
164
+ export var VisualisationToolbar = function VisualisationToolbar(t0) {
165
+ var $ = _c(76);
166
+ var groupBy = t0.groupBy,
167
+ toggleGroupBy = t0.toggleGroupBy,
168
+ setGroupByLabels = t0.setGroupByLabels,
169
+ flamechartDimension = t0.flamechartDimension,
170
+ setFlamechartDimension = t0.setFlamechartDimension,
171
+ profileType = t0.profileType,
172
+ profileSource = t0.profileSource,
173
+ queryClient = t0.queryClient,
174
+ onDownloadPProf = t0.onDownloadPProf,
175
+ pprofdownloading = t0.pprofdownloading,
176
+ profileViewExternalSubActions = t0.profileViewExternalSubActions,
177
+ curPath = t0.curPath,
178
+ setNewCurPath = t0.setNewCurPath,
179
+ total = t0.total,
180
+ filtered = t0.filtered,
181
+ t1 = t0.showVisualizationSelector,
182
+ alignFunctionName = t0.alignFunctionName,
183
+ setAlignFunctionName = t0.setAlignFunctionName,
184
+ colorBy = t0.colorBy,
185
+ setColorBy = t0.setColorBy,
186
+ t2 = t0.metadata;
187
+ var showVisualizationSelector = t1 === undefined ? true : t1;
188
+ var groupByLabels = t2.labels,
189
+ metadataRefetch = t2.refetch,
190
+ metadataLoading = t2.loading;
191
+ var _useDashboard = useDashboard(),
192
+ dashboardItems = _useDashboard.dashboardItems;
193
+ var t3;
194
+ if ($[0] !== dashboardItems) {
195
+ t3 = dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.includes("table");
196
+ $[0] = dashboardItems;
197
+ $[1] = t3;
198
+ } else {
199
+ t3 = $[1];
200
+ }
201
+ var isTableViz = t3;
202
+ var isTableVizOnly = (dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.length) === 1 && isTableViz;
203
+ var t4;
204
+ if ($[2] !== dashboardItems) {
205
+ t4 = dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.includes("flamegraph");
206
+ $[2] = dashboardItems;
207
+ $[3] = t4;
208
+ } else {
209
+ t4 = $[3];
210
+ }
211
+ var isGraphViz = t4;
212
+ var isGraphVizOnly = (dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.length) === 1 && isGraphViz;
213
+ var t5;
214
+ if ($[4] !== dashboardItems) {
215
+ t5 = dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.includes("flamechart");
216
+ $[4] = dashboardItems;
217
+ $[5] = t5;
218
+ } else {
219
+ t5 = $[5];
220
+ }
221
+ var isFlamechartViz = t5;
222
+ var isFlamechartVizOnly = (dashboardItems === null || dashboardItems === void 0 ? void 0 : dashboardItems.length) === 1 && isFlamechartViz;
223
+ var _useParcaContext = useParcaContext(),
224
+ enableFlamechartFiltering = _useParcaContext.enableFlamechartFiltering;
225
+ var req;
226
+ if ($[6] !== groupBy || $[7] !== profileSource) {
227
+ req = profileSource === null || profileSource === void 0 ? void 0 : profileSource.QueryRequest();
33
228
  if (req !== null && req !== undefined) {
34
- req.groupBy = {
35
- fields: groupBy ?? [],
229
+ var _t;
230
+ if ($[9] !== groupBy) {
231
+ _t = groupBy !== null && groupBy !== void 0 ? groupBy : [];
232
+ $[9] = groupBy;
233
+ $[10] = _t;
234
+ } else {
235
+ _t = $[10];
236
+ }
237
+ var _t2;
238
+ if ($[11] !== _t) {
239
+ _t2 = {
240
+ fields: _t
36
241
  };
242
+ $[11] = _t;
243
+ $[12] = _t2;
244
+ } else {
245
+ _t2 = $[12];
246
+ }
247
+ req.groupBy = _t2;
37
248
  }
38
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-start gap-2", children: [_jsxs("div", { className: "flex gap-2 items-start", children: [isGraphViz && (_jsxs(_Fragment, { children: [_jsx(GroupByDropdown, { groupBy: groupBy, labels: groupByLabels, setGroupByLabels: setGroupByLabels, metadataRefetch: metadataRefetch, metadataLoading: metadataLoading }), _jsx(InvertCallStack, {})] })), isFlamechartViz && (_jsx(GroupByDropdown, { groupBy: flamechartDimension, labels: groupByLabels, setGroupByLabels: setFlamechartDimension, metadataRefetch: metadataRefetch, metadataLoading: metadataLoading, label: "Samples group by" })), _jsxs("div", { className: "flex mt-5", children: [(!isFlamechartVizOnly || enableFlamechartFiltering === true) && _jsx(ProfileFilters, {}), profileViewExternalSubActions != null ? profileViewExternalSubActions : null] })] }), _jsxs("div", { className: "flex gap-2 mt-5", children: [_jsx(MultiLevelDropdown, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, profileType: profileType, onSelect: () => { }, isTableVizOnly: isTableVizOnly, alignFunctionName: alignFunctionName, setAlignFunctionName: setAlignFunctionName, colorBy: colorBy, setColorBy: setColorBy }), _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(FlameGraphToolbar, { curPath: curPath, setNewCurPath: setNewCurPath })] })), isTableVizOnly && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(TableToolbar, { profileType: profileType, total: total, filtered: filtered })] }))] }));
249
+ $[6] = groupBy;
250
+ $[7] = profileSource;
251
+ $[8] = req;
252
+ } else {
253
+ req = $[8];
254
+ }
255
+ var t6;
256
+ if ($[13] !== groupBy || $[14] !== groupByLabels || $[15] !== isGraphViz || $[16] !== metadataLoading || $[17] !== metadataRefetch || $[18] !== setGroupByLabels) {
257
+ t6 = isGraphViz && /*#__PURE__*/_jsxs(_Fragment, {
258
+ children: [/*#__PURE__*/_jsx(GroupByDropdown, {
259
+ groupBy: groupBy,
260
+ labels: groupByLabels,
261
+ setGroupByLabels: setGroupByLabels,
262
+ metadataRefetch: metadataRefetch,
263
+ metadataLoading: metadataLoading
264
+ }), /*#__PURE__*/_jsx(InvertCallStack, {})]
265
+ });
266
+ $[13] = groupBy;
267
+ $[14] = groupByLabels;
268
+ $[15] = isGraphViz;
269
+ $[16] = metadataLoading;
270
+ $[17] = metadataRefetch;
271
+ $[18] = setGroupByLabels;
272
+ $[19] = t6;
273
+ } else {
274
+ t6 = $[19];
275
+ }
276
+ var t7;
277
+ if ($[20] !== flamechartDimension || $[21] !== groupByLabels || $[22] !== isFlamechartViz || $[23] !== metadataLoading || $[24] !== metadataRefetch || $[25] !== setFlamechartDimension) {
278
+ t7 = isFlamechartViz && /*#__PURE__*/_jsx(GroupByDropdown, {
279
+ groupBy: flamechartDimension,
280
+ labels: groupByLabels,
281
+ setGroupByLabels: setFlamechartDimension,
282
+ metadataRefetch: metadataRefetch,
283
+ metadataLoading: metadataLoading,
284
+ label: "Samples group by"
285
+ });
286
+ $[20] = flamechartDimension;
287
+ $[21] = groupByLabels;
288
+ $[22] = isFlamechartViz;
289
+ $[23] = metadataLoading;
290
+ $[24] = metadataRefetch;
291
+ $[25] = setFlamechartDimension;
292
+ $[26] = t7;
293
+ } else {
294
+ t7 = $[26];
295
+ }
296
+ var t8;
297
+ if ($[27] !== enableFlamechartFiltering || $[28] !== isFlamechartVizOnly) {
298
+ t8 = (!isFlamechartVizOnly || enableFlamechartFiltering === true) && /*#__PURE__*/_jsx(ProfileFilters, {});
299
+ $[27] = enableFlamechartFiltering;
300
+ $[28] = isFlamechartVizOnly;
301
+ $[29] = t8;
302
+ } else {
303
+ t8 = $[29];
304
+ }
305
+ var t9 = profileViewExternalSubActions != null ? profileViewExternalSubActions : null;
306
+ var t10;
307
+ if ($[30] !== t8 || $[31] !== t9) {
308
+ t10 = /*#__PURE__*/_jsxs("div", {
309
+ className: "flex mt-5",
310
+ children: [t8, t9]
311
+ });
312
+ $[30] = t8;
313
+ $[31] = t9;
314
+ $[32] = t10;
315
+ } else {
316
+ t10 = $[32];
317
+ }
318
+ var t11;
319
+ if ($[33] !== t10 || $[34] !== t6 || $[35] !== t7) {
320
+ t11 = /*#__PURE__*/_jsxs("div", {
321
+ className: "flex gap-2 items-start",
322
+ children: [t6, t7, t10]
323
+ });
324
+ $[33] = t10;
325
+ $[34] = t6;
326
+ $[35] = t7;
327
+ $[36] = t11;
328
+ } else {
329
+ t11 = $[36];
330
+ }
331
+ var t12;
332
+ if ($[37] !== alignFunctionName || $[38] !== colorBy || $[39] !== groupBy || $[40] !== isTableVizOnly || $[41] !== profileType || $[42] !== setAlignFunctionName || $[43] !== setColorBy || $[44] !== toggleGroupBy) {
333
+ t12 = /*#__PURE__*/_jsx(MultiLevelDropdown, {
334
+ groupBy: groupBy,
335
+ toggleGroupBy: toggleGroupBy,
336
+ profileType: profileType,
337
+ onSelect: _temp,
338
+ isTableVizOnly: isTableVizOnly,
339
+ alignFunctionName: alignFunctionName,
340
+ setAlignFunctionName: setAlignFunctionName,
341
+ colorBy: colorBy,
342
+ setColorBy: setColorBy
343
+ });
344
+ $[37] = alignFunctionName;
345
+ $[38] = colorBy;
346
+ $[39] = groupBy;
347
+ $[40] = isTableVizOnly;
348
+ $[41] = profileType;
349
+ $[42] = setAlignFunctionName;
350
+ $[43] = setColorBy;
351
+ $[44] = toggleGroupBy;
352
+ $[45] = t12;
353
+ } else {
354
+ t12 = $[45];
355
+ }
356
+ var t13 = pprofdownloading !== null && pprofdownloading !== void 0 ? pprofdownloading : false;
357
+ var t14;
358
+ if ($[46] !== onDownloadPProf || $[47] !== profileSource || $[48] !== profileViewExternalSubActions || $[49] !== queryClient || $[50] !== req || $[51] !== t13) {
359
+ t14 = /*#__PURE__*/_jsx(ShareButton, {
360
+ profileSource: profileSource,
361
+ queryClient: queryClient,
362
+ queryRequest: req,
363
+ onDownloadPProf: onDownloadPProf,
364
+ pprofdownloading: t13,
365
+ profileViewExternalSubActions: profileViewExternalSubActions
366
+ });
367
+ $[46] = onDownloadPProf;
368
+ $[47] = profileSource;
369
+ $[48] = profileViewExternalSubActions;
370
+ $[49] = queryClient;
371
+ $[50] = req;
372
+ $[51] = t13;
373
+ $[52] = t14;
374
+ } else {
375
+ t14 = $[52];
376
+ }
377
+ var t15;
378
+ if ($[53] !== profileSource || $[54] !== showVisualizationSelector) {
379
+ t15 = showVisualizationSelector ? /*#__PURE__*/_jsx(ViewSelector, {
380
+ profileSource: profileSource
381
+ }) : null;
382
+ $[53] = profileSource;
383
+ $[54] = showVisualizationSelector;
384
+ $[55] = t15;
385
+ } else {
386
+ t15 = $[55];
387
+ }
388
+ var t16;
389
+ if ($[56] !== t12 || $[57] !== t14 || $[58] !== t15) {
390
+ t16 = /*#__PURE__*/_jsxs("div", {
391
+ className: "flex gap-2 mt-5",
392
+ children: [t12, t14, t15]
393
+ });
394
+ $[56] = t12;
395
+ $[57] = t14;
396
+ $[58] = t15;
397
+ $[59] = t16;
398
+ } else {
399
+ t16 = $[59];
400
+ }
401
+ var t17;
402
+ if ($[60] !== t11 || $[61] !== t16) {
403
+ t17 = /*#__PURE__*/_jsxs("div", {
404
+ className: "flex w-full justify-between items-start gap-2",
405
+ children: [t11, t16]
406
+ });
407
+ $[60] = t11;
408
+ $[61] = t16;
409
+ $[62] = t17;
410
+ } else {
411
+ t17 = $[62];
412
+ }
413
+ var t18;
414
+ if ($[63] !== curPath || $[64] !== isGraphVizOnly || $[65] !== setNewCurPath) {
415
+ t18 = isGraphVizOnly && /*#__PURE__*/_jsxs(_Fragment, {
416
+ children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(FlameGraphToolbar, {
417
+ curPath: curPath,
418
+ setNewCurPath: setNewCurPath
419
+ })]
420
+ });
421
+ $[63] = curPath;
422
+ $[64] = isGraphVizOnly;
423
+ $[65] = setNewCurPath;
424
+ $[66] = t18;
425
+ } else {
426
+ t18 = $[66];
427
+ }
428
+ var t19;
429
+ if ($[67] !== filtered || $[68] !== isTableVizOnly || $[69] !== profileType || $[70] !== total) {
430
+ t19 = isTableVizOnly && /*#__PURE__*/_jsxs(_Fragment, {
431
+ children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(TableToolbar, {
432
+ profileType: profileType,
433
+ total: total,
434
+ filtered: filtered
435
+ })]
436
+ });
437
+ $[67] = filtered;
438
+ $[68] = isTableVizOnly;
439
+ $[69] = profileType;
440
+ $[70] = total;
441
+ $[71] = t19;
442
+ } else {
443
+ t19 = $[71];
444
+ }
445
+ var t20;
446
+ if ($[72] !== t17 || $[73] !== t18 || $[74] !== t19) {
447
+ t20 = /*#__PURE__*/_jsxs(_Fragment, {
448
+ children: [t17, t18, t19]
449
+ });
450
+ $[72] = t17;
451
+ $[73] = t18;
452
+ $[74] = t19;
453
+ $[75] = t20;
454
+ } else {
455
+ t20 = $[75];
456
+ }
457
+ return t20;
39
458
  };
459
+ function _temp() {}