@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,4 +1,16 @@
1
- import { jsx as _jsx, 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
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
8
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
9
+ 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."); }
10
+ 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; } }
11
+ 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; }
12
+ 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; } }
13
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
2
14
  // Copyright 2022 The Parca Authors
3
15
  // Licensed under the Apache License, Version 2.0 (the "License");
4
16
  // you may not use this file except in compliance with the License.
@@ -11,7 +23,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
23
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
24
  // See the License for the specific language governing permissions and
13
25
  // limitations under the License.
14
- import { memo, useCallback, useDeferredValue, useEffect, useMemo, useRef, useState, } from 'react';
26
+
27
+ import React, { memo, useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from 'react';
15
28
  import { tableFromIPC } from '@uwdata/flechette';
16
29
  import { useContextMenu } from 'react-contexify';
17
30
  import { FlameGraphSkeleton, SandwichFlameGraphSkeleton, useParcaContext } from '@parca/components';
@@ -31,194 +44,398 @@ import { useBatchedRendering } from './useBatchedRendering';
31
44
  import { useScrollViewport } from './useScrollViewport';
32
45
  import { useVisibleNodes } from './useVisibleNodes';
33
46
  import { useZoom } from './useZoom';
34
- import { boundsFromProfileSource, extractFeature, extractFilenameFeature, getCurrentPathFrameData, getMaxDepth, isCurrentPathFrameMatch, } from './utils';
35
- export const FIELD_LABELS_ONLY = 'labels_only';
36
- export const FIELD_MAPPING_FILE = 'mapping_file';
37
- export const FIELD_MAPPING_BUILD_ID = 'mapping_build_id';
38
- export const FIELD_LOCATION_ADDRESS = 'location_address';
39
- export const FIELD_LOCATION_LINE = 'location_line';
40
- export const FIELD_INLINED = 'inlined';
41
- export const FIELD_TIMESTAMP = 'timestamp';
42
- export const FIELD_DURATION = 'duration';
43
- export const FIELD_GROUPBY_METADATA = 'groupby_metadata';
44
- export const FIELD_FUNCTION_NAME = 'function_name';
45
- export const FIELD_FUNCTION_SYSTEM_NAME = 'function_system_name';
46
- export const FIELD_FUNCTION_FILE_NAME = 'function_file_name';
47
- export const FIELD_FUNCTION_START_LINE = 'function_startline';
48
- export const FIELD_CHILDREN = 'children';
49
- export const FIELD_LABELS = 'labels';
50
- export const FIELD_CUMULATIVE = 'cumulative';
51
- export const FIELD_FLAT = 'flat';
52
- export const FIELD_DIFF = 'diff';
53
- export const FIELD_PARENT = 'parent';
54
- export const FIELD_DEPTH = 'depth';
55
- export const FIELD_VALUE_OFFSET = 'value_offset';
56
- export const getMappingColors = (mappingsList, isDarkMode, currentColorProfile) => {
57
- const mappingFeatures = mappingsList.map(mapping => extractFeature(mapping));
58
- const colors = {};
59
- Object.entries(mappingFeatures).forEach(([_, feature]) => {
60
- colors[feature.name] = getColorForFeature(feature.name, isDarkMode, currentColorProfile.colors);
61
- });
62
- return colors;
47
+ import { boundsFromProfileSource, extractFeature, extractFilenameFeature, getCurrentPathFrameData, getMaxDepth, isCurrentPathFrameMatch } from './utils';
48
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
+ export var FIELD_LABELS_ONLY = 'labels_only';
50
+ export var FIELD_MAPPING_FILE = 'mapping_file';
51
+ export var FIELD_MAPPING_BUILD_ID = 'mapping_build_id';
52
+ export var FIELD_LOCATION_ADDRESS = 'location_address';
53
+ export var FIELD_LOCATION_LINE = 'location_line';
54
+ export var FIELD_INLINED = 'inlined';
55
+ export var FIELD_TIMESTAMP = 'timestamp';
56
+ export var FIELD_DURATION = 'duration';
57
+ export var FIELD_GROUPBY_METADATA = 'groupby_metadata';
58
+ export var FIELD_FUNCTION_NAME = 'function_name';
59
+ export var FIELD_FUNCTION_SYSTEM_NAME = 'function_system_name';
60
+ export var FIELD_FUNCTION_FILE_NAME = 'function_file_name';
61
+ export var FIELD_FUNCTION_START_LINE = 'function_startline';
62
+ export var FIELD_CHILDREN = 'children';
63
+ export var FIELD_LABELS = 'labels';
64
+ export var FIELD_CUMULATIVE = 'cumulative';
65
+ export var FIELD_FLAT = 'flat';
66
+ export var FIELD_DIFF = 'diff';
67
+ export var FIELD_PARENT = 'parent';
68
+ export var FIELD_DEPTH = 'depth';
69
+ export var FIELD_VALUE_OFFSET = 'value_offset';
70
+ export var getMappingColors = function getMappingColors(mappingsList, isDarkMode, currentColorProfile) {
71
+ var mappingFeatures = mappingsList.map(function (mapping) {
72
+ return extractFeature(mapping);
73
+ });
74
+ var colors = {};
75
+ Object.entries(mappingFeatures).forEach(function (_ref) {
76
+ var _ref2 = _slicedToArray(_ref, 2),
77
+ _ = _ref2[0],
78
+ feature = _ref2[1];
79
+ colors[feature.name] = getColorForFeature(feature.name, isDarkMode, currentColorProfile.colors);
80
+ });
81
+ return colors;
82
+ };
83
+ export var getFilenameColors = function getFilenameColors(filenamesList, isDarkMode, currentColorProfile) {
84
+ var filenameFeatures = filenamesList.map(function (filename) {
85
+ return extractFilenameFeature(filename);
86
+ });
87
+ var colors = {};
88
+ Object.entries(filenameFeatures).forEach(function (_ref3) {
89
+ var _ref4 = _slicedToArray(_ref3, 2),
90
+ _ = _ref4[0],
91
+ feature = _ref4[1];
92
+ colors[feature.name] = getColorForFeature(feature.name, isDarkMode, currentColorProfile.colors);
93
+ });
94
+ return colors;
63
95
  };
64
- export const getFilenameColors = (filenamesList, isDarkMode, currentColorProfile) => {
65
- const filenameFeatures = filenamesList.map(filename => extractFilenameFeature(filename));
66
- const colors = {};
67
- Object.entries(filenameFeatures).forEach(([_, feature]) => {
68
- colors[feature.name] = getColorForFeature(feature.name, isDarkMode, currentColorProfile.colors);
96
+ var noop = function noop() {};
97
+ export var FlameGraphArrow = /*#__PURE__*/memo(function FlameGraphArrow(_ref5) {
98
+ var _table$getChild2;
99
+ var arrow = _ref5.arrow,
100
+ total = _ref5.total,
101
+ filtered = _ref5.filtered,
102
+ width = _ref5.width,
103
+ setCurPath = _ref5.setCurPath,
104
+ curPath = _ref5.curPath,
105
+ profileType = _ref5.profileType,
106
+ profileSource = _ref5.profileSource,
107
+ compareAbsolute = _ref5.compareAbsolute,
108
+ _ref5$isFlameChart = _ref5.isFlameChart,
109
+ isFlameChart = _ref5$isFlameChart === void 0 ? false : _ref5$isFlameChart,
110
+ _ref5$isRenderedAsFla = _ref5.isRenderedAsFlamegraph,
111
+ isRenderedAsFlamegraph = _ref5$isRenderedAsFla === void 0 ? false : _ref5$isRenderedAsFla,
112
+ _ref5$isInSandwichVie = _ref5.isInSandwichView,
113
+ isInSandwichView = _ref5$isInSandwichVie === void 0 ? false : _ref5$isInSandwichVie,
114
+ isHalfScreen = _ref5.isHalfScreen,
115
+ _ref5$tooltipId = _ref5.tooltipId,
116
+ tooltipId = _ref5$tooltipId === void 0 ? 'default' : _ref5$tooltipId,
117
+ maxFrameCount = _ref5.maxFrameCount,
118
+ _ref5$isExpanded = _ref5.isExpanded,
119
+ isExpanded = _ref5$isExpanded === void 0 ? false : _ref5$isExpanded,
120
+ mappingsListFromMetadata = _ref5.mappingsListFromMetadata,
121
+ filenamesListFromMetadata = _ref5.filenamesListFromMetadata,
122
+ colorBy = _ref5.colorBy,
123
+ zoomControlsRef = _ref5.zoomControlsRef;
124
+ var _useUserPreference = useUserPreference(USER_PREFERENCES.HIGHLIGHT_SIMILAR_STACKS.key),
125
+ _useUserPreference2 = _slicedToArray(_useUserPreference, 1),
126
+ highlightSimilarStacksPreference = _useUserPreference2[0];
127
+ var _useState = useState(undefined),
128
+ _useState2 = _slicedToArray(_useState, 2),
129
+ hoveringRow = _useState2[0],
130
+ setHoveringRow = _useState2[1];
131
+ var _useUserPreference3 = useUserPreference(USER_PREFERENCES.GRAPH_METAINFO_DOCKED.key),
132
+ _useUserPreference4 = _slicedToArray(_useUserPreference3, 1),
133
+ dockedMetainfo = _useUserPreference4[0];
134
+ var _useParcaContext = useParcaContext(),
135
+ perf = _useParcaContext.perf,
136
+ isDarkMode = _useParcaContext.isDarkMode;
137
+ var table = useMemo(function () {
138
+ var result = tableFromIPC(alignedUint8Array(arrow.record), {
139
+ useBigInt: true
69
140
  });
141
+ if ((perf === null || perf === void 0 ? void 0 : perf.setMeasurement) != null) {
142
+ perf.setMeasurement('flamegraph.node_count', result.numRows);
143
+ }
144
+ return result;
145
+ }, [arrow, perf]);
146
+ var svg = useRef(null);
147
+ var containerRef = useRef(null);
148
+ var renderStartTime = useRef(0);
149
+ var hasInitialRenderCompleted = useRef(false);
150
+ var _useState3 = useState(null),
151
+ _useState4 = _slicedToArray(_useState3, 2),
152
+ svgElement = _useState4[0],
153
+ setSvgElement = _useState4[1];
154
+ var _useProfileFilters = useProfileFilters(),
155
+ excludeBinary = _useProfileFilters.excludeBinary;
156
+ var _useProfileViewContex = useProfileViewContext(),
157
+ compareMode = _useProfileViewContex.compareMode;
158
+ var currentColorProfile = useCurrentColorProfile();
159
+ var colorForSimilarNodes = currentColorProfile.colorForSimilarNodes;
160
+ var colorByValue = colorBy === undefined || colorBy === '' ? 'binary' : colorBy;
161
+ var filenameColors = useMemo(function () {
162
+ var colors = getFilenameColors(filenamesListFromMetadata, isDarkMode, currentColorProfile);
70
163
  return colors;
71
- };
72
- const noop = () => { };
73
- export const FlameGraphArrow = memo(function FlameGraphArrow({ arrow, total, filtered, width, setCurPath, curPath, profileType, profileSource, compareAbsolute, isFlameChart = false, isRenderedAsFlamegraph = false, isInSandwichView = false, isHalfScreen, tooltipId = 'default', maxFrameCount, isExpanded = false, mappingsListFromMetadata, filenamesListFromMetadata, colorBy, zoomControlsRef, }) {
74
- const [highlightSimilarStacksPreference] = useUserPreference(USER_PREFERENCES.HIGHLIGHT_SIMILAR_STACKS.key);
75
- const [hoveringRow, setHoveringRow] = useState(undefined);
76
- const [dockedMetainfo] = useUserPreference(USER_PREFERENCES.GRAPH_METAINFO_DOCKED.key);
77
- const { perf, isDarkMode } = useParcaContext();
78
- const table = useMemo(() => {
79
- const result = tableFromIPC(alignedUint8Array(arrow.record), { useBigInt: true });
80
- if (perf?.setMeasurement != null) {
81
- perf.setMeasurement('flamegraph.node_count', result.numRows);
82
- }
83
- return result;
84
- }, [arrow, perf]);
85
- const svg = useRef(null);
86
- const containerRef = useRef(null);
87
- const renderStartTime = useRef(0);
88
- const hasInitialRenderCompleted = useRef(false);
89
- const [svgElement, setSvgElement] = useState(null);
90
- const { excludeBinary } = useProfileFilters();
91
- const { compareMode } = useProfileViewContext();
92
- const currentColorProfile = useCurrentColorProfile();
93
- const colorForSimilarNodes = currentColorProfile.colorForSimilarNodes;
94
- const colorByValue = colorBy === undefined || colorBy === '' ? 'binary' : colorBy;
95
- const filenameColors = useMemo(() => {
96
- const colors = getFilenameColors(filenamesListFromMetadata, isDarkMode, currentColorProfile);
97
- return colors;
98
- }, [isDarkMode, filenamesListFromMetadata, currentColorProfile]);
99
- const mappingColors = useMemo(() => {
100
- const colors = getMappingColors(mappingsListFromMetadata, isDarkMode, currentColorProfile);
101
- return colors;
102
- }, [isDarkMode, mappingsListFromMetadata, currentColorProfile]);
103
- const colorByList = {
104
- filename: filenameColors,
105
- binary: mappingColors,
106
- };
107
- const colorByColors = colorByList[colorByValue];
108
- const MENU_ID = 'flame-graph-context-menu';
109
- const contextMenuRef = useRef(null);
110
- const { show, hideAll } = useContextMenu({
111
- id: MENU_ID,
164
+ }, [isDarkMode, filenamesListFromMetadata, currentColorProfile]);
165
+ var mappingColors = useMemo(function () {
166
+ var colors_0 = getMappingColors(mappingsListFromMetadata, isDarkMode, currentColorProfile);
167
+ return colors_0;
168
+ }, [isDarkMode, mappingsListFromMetadata, currentColorProfile]);
169
+ var colorByList = {
170
+ filename: filenameColors,
171
+ binary: mappingColors
172
+ };
173
+ var colorByColors = colorByList[colorByValue];
174
+ var MENU_ID = 'flame-graph-context-menu';
175
+ var contextMenuRef = useRef(null);
176
+ var _useContextMenu = useContextMenu({
177
+ id: MENU_ID
178
+ }),
179
+ show = _useContextMenu.show,
180
+ hideAll = _useContextMenu.hideAll;
181
+ var displayMenu = useCallback(function (e, row) {
182
+ var _contextMenuRef$curre;
183
+ e.preventDefault();
184
+ // Race condition fix: Use callback to ensure context menu shows only after
185
+ // row state has been updated and propagated through the hook chain.
186
+ // This prevents empty function names on first click.
187
+ (_contextMenuRef$curre = contextMenuRef.current) === null || _contextMenuRef$curre === void 0 || _contextMenuRef$curre.setRow(row, function () {
188
+ show({
189
+ event: e
190
+ });
112
191
  });
113
- const displayMenu = useCallback((e, row) => {
114
- e.preventDefault();
115
- // Race condition fix: Use callback to ensure context menu shows only after
116
- // row state has been updated and propagated through the hook chain.
117
- // This prevents empty function names on first click.
118
- contextMenuRef.current?.setRow(row, () => {
119
- show({
120
- event: e,
121
- });
122
- });
123
- }, [show]);
124
- const hideBinary = (binaryToRemove) => {
125
- // Add a new frame filter to hide this binary using the new ProfileFilters system
126
- excludeBinary(binaryToRemove);
127
- };
128
- const handleRowClick = useCallback((row) => {
129
- if (isFlameChart) {
130
- // In flame charts, we don't want to expand the node, so we return early.
131
- return;
132
- }
133
- // Walk down the stack starting at row until we reach the root (row 0).
134
- const path = [];
135
- let currentRow = row;
136
- while (currentRow > 0) {
137
- const frame = getCurrentPathFrameData(table, currentRow);
138
- path.push(frame);
139
- currentRow = table.getChild(FIELD_PARENT)?.get(currentRow) ?? 0;
140
- }
141
- // Reverse the path so that the root is first.
142
- path.reverse();
143
- setCurPath(path);
144
- }, [table, setCurPath, isFlameChart]);
145
- const depthColumn = table.getChild(FIELD_DEPTH);
146
- const maxDepth = getMaxDepth(depthColumn);
147
- const rootCumulative = table.getChild(FIELD_CUMULATIVE)?.get(0);
148
- const isEmptySandwichView = isInSandwichView && table.numRows > 0 && (rootCumulative === null || rootCumulative === 0n);
149
- // Apply frame limit if maxFrameCount is provided and not expanded
150
- const effectiveDepth = maxFrameCount !== undefined && !isExpanded ? Math.min(maxDepth, maxFrameCount) : maxDepth;
151
- // Use deferred value to prevent UI blocking when expanding frames
152
- const deferredEffectiveDepth = useDeferredValue(effectiveDepth);
153
- const totalHeight = isInSandwichView
154
- ? deferredEffectiveDepth * RowHeight
155
- : (deferredEffectiveDepth + 1) * RowHeight;
156
- // Get the viewport of the container, this is used to determine which rows are visible.
157
- const viewport = useScrollViewport(containerRef);
158
- const isZoomEnabled = isFlameChart;
159
- const { zoomLevel, zoomIn, zoomOut, resetZoom, zoomToPosition, setZoomWithScroll, scrollLeftRef } = useZoom(isZoomEnabled ? containerRef : { current: null });
160
- const zoomedWidth = isZoomEnabled ? Math.round((width ?? 1) * zoomLevel) : width ?? 0;
161
- // Reset zoom when the data changes (e.g. new query, different time range)
162
- useEffect(() => {
163
- resetZoom();
164
- }, [table, resetZoom]);
165
- // To find the selected row, we must walk the current path and look at which
166
- // children of the current frame matches the path element exactly. Until the
167
- // end, the row we find at the end is our selected row.
168
- let currentRow = 0;
169
- for (const frame of curPath) {
170
- let childRows = Array.from(table.getChild(FIELD_CHILDREN)?.get(currentRow) ?? []);
192
+ }, [show]);
193
+ var hideBinary = function hideBinary(binaryToRemove) {
194
+ // Add a new frame filter to hide this binary using the new ProfileFilters system
195
+ excludeBinary(binaryToRemove);
196
+ };
197
+ var handleRowClick = useCallback(function (row_0) {
198
+ if (isFlameChart) {
199
+ // In flame charts, we don't want to expand the node, so we return early.
200
+ return;
201
+ }
202
+ // Walk down the stack starting at row until we reach the root (row 0).
203
+ var path = [];
204
+ var currentRow = row_0;
205
+ while (currentRow > 0) {
206
+ var _table$getChild$get, _table$getChild;
207
+ var frame = getCurrentPathFrameData(table, currentRow);
208
+ path.push(frame);
209
+ currentRow = (_table$getChild$get = (_table$getChild = table.getChild(FIELD_PARENT)) === null || _table$getChild === void 0 ? void 0 : _table$getChild.get(currentRow)) !== null && _table$getChild$get !== void 0 ? _table$getChild$get : 0;
210
+ }
211
+
212
+ // Reverse the path so that the root is first.
213
+ path.reverse();
214
+ setCurPath(path);
215
+ }, [table, setCurPath, isFlameChart]);
216
+ var depthColumn = table.getChild(FIELD_DEPTH);
217
+ var maxDepth = getMaxDepth(depthColumn);
218
+ var rootCumulative = (_table$getChild2 = table.getChild(FIELD_CUMULATIVE)) === null || _table$getChild2 === void 0 ? void 0 : _table$getChild2.get(0);
219
+ var isEmptySandwichView = isInSandwichView && table.numRows > 0 && (rootCumulative === null || rootCumulative === 0n);
220
+
221
+ // Apply frame limit if maxFrameCount is provided and not expanded
222
+ var effectiveDepth = maxFrameCount !== undefined && !isExpanded ? Math.min(maxDepth, maxFrameCount) : maxDepth;
223
+
224
+ // Use deferred value to prevent UI blocking when expanding frames
225
+ var deferredEffectiveDepth = useDeferredValue(effectiveDepth);
226
+ var totalHeight = isInSandwichView ? deferredEffectiveDepth * RowHeight : (deferredEffectiveDepth + 1) * RowHeight;
227
+
228
+ // Get the viewport of the container, this is used to determine which rows are visible.
229
+ var viewport = useScrollViewport(containerRef);
230
+ var isZoomEnabled = isFlameChart;
231
+ var _useZoom = useZoom(isZoomEnabled ? containerRef : {
232
+ current: null
233
+ }),
234
+ zoomLevel = _useZoom.zoomLevel,
235
+ zoomIn = _useZoom.zoomIn,
236
+ zoomOut = _useZoom.zoomOut,
237
+ resetZoom = _useZoom.resetZoom,
238
+ zoomToPosition = _useZoom.zoomToPosition,
239
+ setZoomWithScroll = _useZoom.setZoomWithScroll,
240
+ scrollLeftRef = _useZoom.scrollLeftRef;
241
+ var zoomedWidth = isZoomEnabled ? Math.round((width !== null && width !== void 0 ? width : 1) * zoomLevel) : width !== null && width !== void 0 ? width : 0;
242
+
243
+ // Reset zoom when the data changes (e.g. new query, different time range)
244
+ useEffect(function () {
245
+ resetZoom();
246
+ }, [table, resetZoom]);
247
+
248
+ // To find the selected row, we must walk the current path and look at which
249
+ // children of the current frame matches the path element exactly. Until the
250
+ // end, the row we find at the end is our selected row.
251
+ var currentRow_0 = 0;
252
+ var _iterator = _createForOfIteratorHelper(curPath),
253
+ _step;
254
+ try {
255
+ var _loop = function _loop() {
256
+ var _table$getChild$get2, _table$getChild3;
257
+ var frame_0 = _step.value;
258
+ var childRows = Array.from((_table$getChild$get2 = (_table$getChild3 = table.getChild(FIELD_CHILDREN)) === null || _table$getChild3 === void 0 ? void 0 : _table$getChild3.get(currentRow_0)) !== null && _table$getChild$get2 !== void 0 ? _table$getChild$get2 : []);
171
259
  if (childRows.length === 0) {
172
- // If there are no children, we can stop here.
173
- break;
260
+ // If there are no children, we can stop here.
261
+ return 0; // break
174
262
  }
175
- childRows = childRows.filter(c => isCurrentPathFrameMatch(table, c, frame));
263
+ childRows = childRows.filter(function (c) {
264
+ return isCurrentPathFrameMatch(table, c, frame_0);
265
+ });
176
266
  if (childRows.length === 0) {
177
- // If there are no children that match the current path frame, we can stop here.
178
- break;
267
+ // If there are no children that match the current path frame, we can stop here.
268
+ return 0; // break
179
269
  }
180
270
  if (childRows.length > 1) {
181
- // If there are multiple children that match the current path frame, we can stop here.
182
- // This is a case where the path is ambiguous and we cannot determine a single row.
183
- break;
271
+ // If there are multiple children that match the current path frame, we can stop here.
272
+ // This is a case where the path is ambiguous and we cannot determine a single row.
273
+ return 0; // break
184
274
  }
185
275
  // If there is exactly one child that matches the current path frame, we can continue.
186
- currentRow = childRows[0];
276
+ currentRow_0 = childRows[0];
277
+ },
278
+ _ret;
279
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
280
+ _ret = _loop();
281
+ if (_ret === 0) break;
187
282
  }
188
- const selectedRow = currentRow;
189
- const visibleNodes = useVisibleNodes({
190
- table,
191
- viewport,
192
- total,
193
- width: zoomedWidth,
194
- selectedRow,
195
- effectiveDepth: deferredEffectiveDepth,
196
- });
197
- // Add nodes in incremental batches to avoid blocking the UI
198
- const { items: batchedNodes, isComplete: isBatchingComplete } = useBatchedRendering(visibleNodes, {
199
- batchSize: 500,
200
- });
201
- if (isBatchingComplete) {
202
- hasInitialRenderCompleted.current = true;
203
- }
204
- // Show skeleton only during initial load, not during scroll updates
205
- const showSkeleton = !hasInitialRenderCompleted.current && batchedNodes.length !== visibleNodes.length;
206
- useEffect(() => {
207
- if (perf?.markInteraction != null) {
208
- renderStartTime.current = performance.now();
209
- }
210
- }, [table, width, curPath, perf]);
211
- useEffect(() => {
212
- setSvgElement(svg.current);
213
- }, [tooltipId]);
214
- if (isEmptySandwichView) {
215
- return _jsx("div", { className: "mx-auto text-center", children: "No matching samples found" });
283
+ } catch (err) {
284
+ _iterator.e(err);
285
+ } finally {
286
+ _iterator.f();
287
+ }
288
+ var selectedRow = currentRow_0;
289
+ var visibleNodes = useVisibleNodes({
290
+ table: table,
291
+ viewport: viewport,
292
+ total: total,
293
+ width: zoomedWidth,
294
+ selectedRow: selectedRow,
295
+ effectiveDepth: deferredEffectiveDepth
296
+ });
297
+
298
+ // Add nodes in incremental batches to avoid blocking the UI
299
+ var _useBatchedRendering = useBatchedRendering(visibleNodes, {
300
+ batchSize: 500
301
+ }),
302
+ batchedNodes = _useBatchedRendering.items,
303
+ isBatchingComplete = _useBatchedRendering.isComplete;
304
+ if (isBatchingComplete) {
305
+ hasInitialRenderCompleted.current = true;
306
+ }
307
+
308
+ // Show skeleton only during initial load, not during scroll updates
309
+ var showSkeleton = !hasInitialRenderCompleted.current && batchedNodes.length !== visibleNodes.length;
310
+ useEffect(function () {
311
+ if ((perf === null || perf === void 0 ? void 0 : perf.markInteraction) != null) {
312
+ renderStartTime.current = performance.now();
216
313
  }
217
- return (_jsx(TooltipProvider, { table: table, total: total, totalUnfiltered: total + filtered, profileType: profileType, unit: arrow.unit, compareAbsolute: compareAbsolute, tooltipId: tooltipId, children: _jsxs("div", { className: "relative", children: [isZoomEnabled && (_jsx(ZoomControls, { zoomLevel: zoomLevel, zoomIn: zoomIn, zoomOut: zoomOut, resetZoom: resetZoom, portalRef: zoomControlsRef })), _jsx(ContextMenuWrapper, { ref: contextMenuRef, menuId: MENU_ID, table: table, total: total, totalUnfiltered: total + filtered, compareAbsolute: compareAbsolute, resetPath: () => setCurPath([]), hideMenu: hideAll, hideBinary: hideBinary, unit: arrow.unit, profileType: profileType, isInSandwichView: isInSandwichView }), _jsx(MemoizedTooltip, { contextElement: svgElement, dockedMetainfo: dockedMetainfo }), showSkeleton && (_jsx("div", { className: "absolute inset-0 z-10", children: isRenderedAsFlamegraph ? (_jsx(SandwichFlameGraphSkeleton, { isHalfScreen: isHalfScreen, isDarkMode: isDarkMode })) : (_jsx(FlameGraphSkeleton, { isHalfScreen: isHalfScreen, isDarkMode: isDarkMode })) })), isZoomEnabled && (_jsx(MiniMap, { containerRef: containerRef, table: table, width: width ?? 0, zoomedWidth: zoomedWidth, totalHeight: totalHeight, maxDepth: deferredEffectiveDepth, colorByColors: colorByColors, colorBy: colorByValue, profileSource: profileSource, isDarkMode: isDarkMode, scrollLeft: viewport.scrollLeft, scrollLeftRef: scrollLeftRef, onZoomToPosition: zoomToPosition, onSetZoomWithScroll: setZoomWithScroll })), _jsx("div", { ref: containerRef, className: `${isZoomEnabled ? '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden' : ''} will-change-transform webkit-overflow-scrolling-touch contain ${!isZoomEnabled ? 'overflow-auto' : ''}`, style: {
218
- width: width ?? '100%',
219
- ...(isZoomEnabled ? { overflowX: 'scroll', overflowY: 'auto' } : {}),
220
- contain: 'layout style paint',
221
- visibility: !showSkeleton ? 'visible' : 'hidden',
222
- }, children: _jsxs("div", { children: [isFlameChart && (_jsx(TimelineGuide, { bounds: boundsFromProfileSource(profileSource), width: zoomedWidth, height: totalHeight, margin: 0, ticks: 12, timeUnit: "nanoseconds" })), _jsx("svg", { className: "relative font-robotoMono", width: zoomedWidth, height: totalHeight, preserveAspectRatio: "xMinYMid", ref: svg, children: batchedNodes.map(row => (_jsx(FlameNode, { table: table, row: row, colors: colorByColors, colorBy: colorByValue, totalWidth: zoomedWidth, height: RowHeight, darkMode: isDarkMode, compareMode: compareMode, colorForSimilarNodes: colorForSimilarNodes, selectedRow: selectedRow, onClick: () => handleRowClick(row), onContextMenu: displayMenu, hoveringRow: highlightSimilarStacksPreference ? hoveringRow : undefined, setHoveringRow: highlightSimilarStacksPreference ? setHoveringRow : noop, isFlameChart: isFlameChart, profileSource: profileSource, isRenderedAsFlamegraph: isRenderedAsFlamegraph, isInSandwichView: isInSandwichView, maxDepth: maxDepth, effectiveDepth: deferredEffectiveDepth, tooltipId: tooltipId }, row))) })] }) })] }) }));
314
+ }, [table, width, curPath, perf]);
315
+ useEffect(function () {
316
+ setSvgElement(svg.current);
317
+ }, [tooltipId]);
318
+ if (isEmptySandwichView) {
319
+ return /*#__PURE__*/_jsx("div", {
320
+ className: "mx-auto text-center",
321
+ children: "No matching samples found"
322
+ });
323
+ }
324
+ return /*#__PURE__*/_jsx(TooltipProvider, {
325
+ table: table,
326
+ total: total,
327
+ totalUnfiltered: total + filtered,
328
+ profileType: profileType,
329
+ unit: arrow.unit,
330
+ compareAbsolute: compareAbsolute,
331
+ tooltipId: tooltipId,
332
+ children: /*#__PURE__*/_jsxs("div", {
333
+ className: "relative",
334
+ children: [isZoomEnabled && /*#__PURE__*/_jsx(ZoomControls, {
335
+ zoomLevel: zoomLevel,
336
+ zoomIn: zoomIn,
337
+ zoomOut: zoomOut,
338
+ resetZoom: resetZoom,
339
+ portalRef: zoomControlsRef
340
+ }), /*#__PURE__*/_jsx(ContextMenuWrapper, {
341
+ ref: contextMenuRef,
342
+ menuId: MENU_ID,
343
+ table: table,
344
+ total: total,
345
+ totalUnfiltered: total + filtered,
346
+ compareAbsolute: compareAbsolute,
347
+ resetPath: function resetPath() {
348
+ return setCurPath([]);
349
+ },
350
+ hideMenu: hideAll,
351
+ hideBinary: hideBinary,
352
+ unit: arrow.unit,
353
+ profileType: profileType,
354
+ isInSandwichView: isInSandwichView
355
+ }), /*#__PURE__*/_jsx(MemoizedTooltip, {
356
+ contextElement: svgElement,
357
+ dockedMetainfo: dockedMetainfo
358
+ }), showSkeleton && /*#__PURE__*/_jsx("div", {
359
+ className: "absolute inset-0 z-10",
360
+ children: isRenderedAsFlamegraph ? /*#__PURE__*/_jsx(SandwichFlameGraphSkeleton, {
361
+ isHalfScreen: isHalfScreen,
362
+ isDarkMode: isDarkMode
363
+ }) : /*#__PURE__*/_jsx(FlameGraphSkeleton, {
364
+ isHalfScreen: isHalfScreen,
365
+ isDarkMode: isDarkMode
366
+ })
367
+ }), isZoomEnabled && /*#__PURE__*/_jsx(MiniMap, {
368
+ containerRef: containerRef,
369
+ table: table,
370
+ width: width !== null && width !== void 0 ? width : 0,
371
+ zoomedWidth: zoomedWidth,
372
+ totalHeight: totalHeight,
373
+ maxDepth: deferredEffectiveDepth,
374
+ colorByColors: colorByColors,
375
+ colorBy: colorByValue,
376
+ profileSource: profileSource,
377
+ isDarkMode: isDarkMode,
378
+ scrollLeft: viewport.scrollLeft,
379
+ scrollLeftRef: scrollLeftRef,
380
+ onZoomToPosition: zoomToPosition,
381
+ onSetZoomWithScroll: setZoomWithScroll
382
+ }), /*#__PURE__*/_jsx("div", {
383
+ ref: containerRef,
384
+ className: "".concat(isZoomEnabled ? '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden' : '', " will-change-transform webkit-overflow-scrolling-touch contain ").concat(!isZoomEnabled ? 'overflow-auto' : ''),
385
+ style: _objectSpread(_objectSpread({
386
+ width: width !== null && width !== void 0 ? width : '100%'
387
+ }, isZoomEnabled ? {
388
+ overflowX: 'scroll',
389
+ overflowY: 'auto'
390
+ } : {}), {}, {
391
+ contain: 'layout style paint',
392
+ visibility: !showSkeleton ? 'visible' : 'hidden'
393
+ }),
394
+ children: /*#__PURE__*/_jsxs("div", {
395
+ children: [isFlameChart && /*#__PURE__*/_jsx(TimelineGuide, {
396
+ bounds: boundsFromProfileSource(profileSource),
397
+ width: zoomedWidth,
398
+ height: totalHeight,
399
+ margin: 0,
400
+ ticks: 12,
401
+ timeUnit: "nanoseconds"
402
+ }), /*#__PURE__*/_jsx("svg", {
403
+ className: "relative font-robotoMono",
404
+ width: zoomedWidth,
405
+ height: totalHeight,
406
+ preserveAspectRatio: "xMinYMid",
407
+ ref: svg,
408
+ children: batchedNodes.map(function (row_1) {
409
+ return /*#__PURE__*/_jsx(FlameNode, {
410
+ table: table,
411
+ row: row_1,
412
+ colors: colorByColors,
413
+ colorBy: colorByValue,
414
+ totalWidth: zoomedWidth,
415
+ height: RowHeight,
416
+ darkMode: isDarkMode,
417
+ compareMode: compareMode,
418
+ colorForSimilarNodes: colorForSimilarNodes,
419
+ selectedRow: selectedRow,
420
+ onClick: function onClick() {
421
+ return handleRowClick(row_1);
422
+ },
423
+ onContextMenu: displayMenu,
424
+ hoveringRow: highlightSimilarStacksPreference ? hoveringRow : undefined,
425
+ setHoveringRow: highlightSimilarStacksPreference ? setHoveringRow : noop,
426
+ isFlameChart: isFlameChart,
427
+ profileSource: profileSource,
428
+ isRenderedAsFlamegraph: isRenderedAsFlamegraph,
429
+ isInSandwichView: isInSandwichView,
430
+ maxDepth: maxDepth,
431
+ effectiveDepth: deferredEffectiveDepth,
432
+ tooltipId: tooltipId
433
+ }, row_1);
434
+ })
435
+ })]
436
+ })
437
+ })]
438
+ })
439
+ });
223
440
  });
224
- export default FlameGraphArrow;
441
+ export default FlameGraphArrow;
@@ -1 +1 @@
1
- {"version":3,"file":"useBatchedRendering.d.ts","sourceRoot":"","sources":["../../../src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts"],"names":[],"mappings":"AAeA,UAAU,0BAA0B;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,yBAAyB,CAAC,CAAC;IACnC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;CACrB;AAGD,eAAO,MAAM,mBAAmB,GAAI,CAAC,EACnC,OAAO,CAAC,EAAE,EACV,UAAS,0BAA+B,KACvC,yBAAyB,CAAC,CAAC,CAqD7B,CAAC"}
1
+ {"version":3,"file":"useBatchedRendering.d.ts","sourceRoot":"","sources":["../../../src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts"],"names":[],"mappings":"AAiBA,UAAU,0BAA0B;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,yBAAyB,CAAC,CAAC;IACnC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;CACrB;AAGD,eAAO,MAAM,mBAAmB,GAAI,CAAC,EACnC,OAAO,CAAC,EAAE,EACV,UAAS,0BAA+B,KACvC,yBAAyB,CAAC,CAAC,CAsD7B,CAAC"}