@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.
- package/CHANGELOG.md +5 -1
- package/dist/GraphTooltipArrow/Content.js +224 -30
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
- package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
- package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/index.js +86 -56
- package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +104 -72
- package/dist/MatchersInput/SuggestionItem.js +91 -12
- package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
- package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
- package/dist/MatchersInput/SuggestionsList.js +371 -157
- package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
- package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
- package/dist/MatchersInput/index.js +308 -115
- package/dist/MetricsCircle/index.js +39 -3
- package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
- package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
- package/dist/MetricsGraph/index.js +552 -203
- package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
- package/dist/MetricsGraph/utils/colorMapping.js +24 -17
- package/dist/MetricsSeries/index.js +70 -7
- package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
- package/dist/PreSelectedMatchers/index.js +249 -102
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +241 -45
- package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
- package/dist/ProfileExplorer/index.js +183 -32
- package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
- package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
- package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
- package/dist/ProfileFlameChart/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/index.js +267 -129
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +288 -89
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
- package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +72 -47
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
- package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
- package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
- package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
- package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
- package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
- package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
- package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
- package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/index.js +324 -150
- package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.js +519 -258
- package/dist/ProfileSelector/CompareButton.js +132 -12
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +236 -64
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +727 -141
- package/dist/ProfileSelector/useAutoQuerySelector.js +249 -130
- package/dist/ProfileSource.js +230 -163
- package/dist/ProfileTypeSelector/index.js +214 -125
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +141 -35
- package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
- package/dist/ProfileView/components/ColorStackLegend.js +185 -55
- package/dist/ProfileView/components/DashboardItems/index.js +87 -28
- package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
- package/dist/ProfileView/components/DiffLegend.js +172 -29
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
- package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
- package/dist/ProfileView/components/InvertCallStack/index.js +100 -12
- package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
- package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
- package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +2 -1
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +188 -118
- package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
- package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
- package/dist/ProfileView/components/ShareButton/index.js +352 -62
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +678 -194
- package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +199 -157
- package/dist/ProfileView/components/Toolbars/index.d.ts +2 -2
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +441 -21
- package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
- package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/index.js +212 -86
- package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
- package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
- package/dist/ProfileView/components/VisualizationPanel.js +185 -8
- package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
- package/dist/ProfileView/context/DashboardContext.js +85 -29
- package/dist/ProfileView/context/ProfileViewContext.js +56 -15
- package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
- package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
- package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetFlameGraphState.js +32 -12
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +40 -19
- package/dist/ProfileView/hooks/useVisualizationState.d.ts +3 -3
- package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useVisualizationState.js +258 -67
- package/dist/ProfileView/index.js +383 -45
- package/dist/ProfileView/types/visualization.js +1 -13
- package/dist/ProfileView/utils/colorUtils.js +8 -7
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +332 -228
- package/dist/QueryControls/index.js +418 -47
- package/dist/Sandwich/components/CalleesSection.js +54 -4
- package/dist/Sandwich/components/CallersSection.js +97 -27
- package/dist/Sandwich/components/TableSection.js +77 -4
- package/dist/Sandwich/index.d.ts.map +1 -1
- package/dist/Sandwich/index.js +126 -14
- package/dist/Sandwich/utils/processRowData.js +48 -39
- package/dist/SelectWithRefresh/index.js +102 -28
- package/dist/SimpleMatchers/Select.js +520 -187
- package/dist/SimpleMatchers/index.js +590 -288
- package/dist/SourceView/Highlighter.js +230 -70
- package/dist/SourceView/LineNo.js +72 -17
- package/dist/SourceView/index.d.ts.map +1 -1
- package/dist/SourceView/index.js +178 -104
- package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
- package/dist/SourceView/lang-detector/index.js +28 -14
- package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
- package/dist/SourceView/useSelectedLineRange.js +99 -23
- package/dist/Table/ColorCell.js +42 -1
- package/dist/Table/ColumnsVisibility.js +114 -6
- package/dist/Table/MoreDropdown.d.ts.map +1 -1
- package/dist/Table/MoreDropdown.js +122 -25
- package/dist/Table/TableContextMenu.d.ts.map +1 -1
- package/dist/Table/TableContextMenu.js +151 -137
- package/dist/Table/TableContextMenuWrapper.js +59 -14
- package/dist/Table/hooks/useColorManagement.js +58 -16
- package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
- package/dist/Table/hooks/useTableConfiguration.js +333 -169
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +222 -128
- package/dist/Table/utils/functions.js +169 -144
- package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
- package/dist/TimelineGuide/index.js +209 -16
- package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
- package/dist/TopTable/index.d.ts.map +1 -1
- package/dist/TopTable/index.js +342 -123
- package/dist/contexts/LabelsQueryProvider.js +94 -32
- package/dist/contexts/UnifiedLabelsContext.js +114 -49
- package/dist/contexts/utils.js +37 -15
- package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
- package/dist/hooks/useCompareModeMeta.js +158 -64
- package/dist/hooks/useLabels.js +295 -52
- package/dist/hooks/useQueryState.d.ts +3 -3
- package/dist/hooks/useQueryState.d.ts.map +1 -1
- package/dist/hooks/useQueryState.js +373 -332
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -8
- package/dist/testdata/fg-diff.json +3750 -0
- package/dist/testdata/fg-simple.json +1879 -0
- package/dist/testdata/link_data.json +56 -0
- package/dist/testdata/tabular.json +30 -0
- package/dist/testdata/test_flamegraph.json +26846 -0
- package/dist/testdata/test_graph.json +53 -0
- package/dist/useDelayedLoader.js +32 -18
- package/dist/useGrpcQuery/index.js +71 -11
- package/dist/useHasProfileData.js +90 -12
- package/dist/useQuery.js +205 -64
- package/dist/useSumBy.d.ts +1 -1
- package/dist/useSumBy.d.ts.map +1 -1
- package/dist/useSumBy.js +294 -138
- package/dist/utils.js +62 -30
- package/package.json +9 -10
- package/src/GraphTooltipArrow/index.tsx +3 -0
- package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +13 -11
- package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
- package/src/MatchersInput/SuggestionsList.tsx +11 -10
- package/src/MatchersInput/index.tsx +1 -1
- package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
- package/src/PreSelectedMatchers/index.tsx +3 -0
- package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -4
- package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
- package/src/ProfileFlameChart/index.tsx +28 -21
- package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +9 -10
- package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +6 -5
- package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
- package/src/ProfileFlameGraph/index.tsx +9 -6
- package/src/ProfileMetricsGraph/index.tsx +8 -6
- package/src/ProfileSelector/MetricsGraphSection.tsx +10 -5
- package/src/ProfileSelector/index.tsx +61 -39
- package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +6 -10
- package/src/ProfileView/components/ColorStackLegend.tsx +4 -2
- package/src/ProfileView/components/InvertCallStack/index.tsx +4 -5
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +192 -94
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +28 -24
- package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +5 -4
- package/src/ProfileView/components/Toolbars/index.tsx +3 -3
- package/src/ProfileView/components/ViewSelector/index.tsx +16 -9
- package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
- package/src/ProfileView/context/DashboardContext.tsx +6 -6
- package/src/ProfileView/hooks/useResetFlameGraphState.ts +4 -6
- package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +26 -24
- package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +8 -16
- package/src/ProfileView/hooks/useVisualizationState.ts +69 -61
- package/src/ProfileViewWithData.tsx +35 -29
- package/src/Sandwich/index.tsx +3 -4
- package/src/SourceView/index.tsx +2 -4
- package/src/SourceView/useSelectedLineRange.ts +19 -34
- package/src/Table/MoreDropdown.tsx +11 -9
- package/src/Table/TableContextMenu.tsx +13 -10
- package/src/Table/hooks/useTableConfiguration.tsx +11 -16
- package/src/Table/index.tsx +21 -12
- package/src/TopTable/index.tsx +4 -3
- package/src/hooks/useCompareModeMeta.ts +91 -61
- package/src/hooks/useQueryState.test.tsx +345 -275
- package/src/hooks/useQueryState.ts +118 -136
- package/src/index.tsx +15 -16
- package/src/useDelayedLoader.ts +10 -10
- package/src/useSumBy.ts +15 -21
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
- package/dist/hooks/urlParsers.d.ts +0 -18
- package/dist/hooks/urlParsers.d.ts.map +0 -1
- package/dist/hooks/urlParsers.js +0 -32
- package/dist/hooks/useColorBy.d.ts +0 -5
- package/dist/hooks/useColorBy.d.ts.map +0 -1
- package/dist/hooks/useColorBy.js +0 -26
- package/dist/hooks/useDashboardItems.d.ts +0 -5
- package/dist/hooks/useDashboardItems.d.ts.map +0 -1
- package/dist/hooks/useDashboardItems.js +0 -27
- package/dist/hooks/useQueryState.test.js +0 -868
- package/src/hooks/urlParsers.ts +0 -38
- package/src/hooks/useColorBy.ts +0 -42
- package/src/hooks/useDashboardItems.ts +0 -46
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
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 _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
10
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
11
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
12
|
+
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."); }
|
|
13
|
+
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; } }
|
|
14
|
+
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; }
|
|
15
|
+
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; } }
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
17
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
18
|
// Copyright 2022 The Parca Authors
|
|
3
19
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
20
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,208 +27,676 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
11
27
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
28
|
// See the License for the specific language governing permissions and
|
|
13
29
|
// limitations under the License.
|
|
14
|
-
|
|
30
|
+
|
|
31
|
+
/* eslint-disable react-hooks/set-state-in-effect */
|
|
32
|
+
|
|
33
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
15
34
|
import { Menu } from '@headlessui/react';
|
|
16
35
|
import { Icon } from '@iconify/react';
|
|
17
36
|
import cx from 'classnames';
|
|
18
|
-
import {
|
|
37
|
+
import { useURLState } from '@parca/components';
|
|
19
38
|
import { USER_PREFERENCES, useUserPreference } from '@parca/hooks';
|
|
20
|
-
import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_NAME, FIELD_LOCATION_ADDRESS, FIELD_MAPPING_FILE
|
|
21
|
-
import { boolParam, hiddenBinariesParser, stringParam } from '../../../hooks/urlParsers';
|
|
39
|
+
import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_NAME, FIELD_LOCATION_ADDRESS, FIELD_MAPPING_FILE } from '../../../ProfileFlameGraph/FlameGraphArrow';
|
|
22
40
|
import { useProfileViewContext } from '../../context/ProfileViewContext';
|
|
23
41
|
import SwitchMenuItem from './SwitchMenuItem';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
43
|
+
var _MenuItem = function MenuItem(_ref) {
|
|
44
|
+
'use no memo';
|
|
45
|
+
|
|
46
|
+
var label = _ref.label,
|
|
47
|
+
items = _ref.items,
|
|
48
|
+
onclick = _ref.onclick,
|
|
49
|
+
_onSelect = _ref.onSelect,
|
|
50
|
+
_ref$path = _ref.path,
|
|
51
|
+
path = _ref$path === void 0 ? [] : _ref$path,
|
|
52
|
+
id = _ref.id,
|
|
53
|
+
closeDropdown = _ref.closeDropdown,
|
|
54
|
+
_ref$isNested = _ref.isNested,
|
|
55
|
+
isNested = _ref$isNested === void 0 ? false : _ref$isNested,
|
|
56
|
+
activeValueForSortBy = _ref.activeValueForSortBy,
|
|
57
|
+
activeValueForColorBy = _ref.activeValueForColorBy,
|
|
58
|
+
activeValuesForLevel = _ref.activeValuesForLevel,
|
|
59
|
+
value = _ref.value,
|
|
60
|
+
_ref$disabled = _ref.disabled,
|
|
61
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
62
|
+
icon = _ref.icon,
|
|
63
|
+
customSubmenu = _ref.customSubmenu,
|
|
64
|
+
_ref$renderAsDiv = _ref.renderAsDiv,
|
|
65
|
+
renderAsDiv = _ref$renderAsDiv === void 0 ? false : _ref$renderAsDiv;
|
|
66
|
+
var menuRef = useRef(null);
|
|
67
|
+
var _useState = useState(false),
|
|
68
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
69
|
+
shouldOpenLeft = _useState2[0],
|
|
70
|
+
setShouldOpenLeft = _useState2[1];
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
if (items !== undefined && menuRef.current !== null) {
|
|
73
|
+
var rect = menuRef.current.getBoundingClientRect();
|
|
74
|
+
var viewportWidth = window.innerWidth;
|
|
75
|
+
var menuWidth = 224; // w-56 = 14rem = 224px
|
|
76
|
+
var spaceOnRight = viewportWidth - rect.right;
|
|
77
|
+
var spaceOnLeft = rect.left;
|
|
78
|
+
|
|
79
|
+
// Open to the left if there's not enough space on the right but enough on the left
|
|
80
|
+
setShouldOpenLeft(spaceOnRight < menuWidth && spaceOnLeft >= menuWidth);
|
|
49
81
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
82
|
+
}, [items]);
|
|
83
|
+
var isActive = false;
|
|
84
|
+
if (isNested) {
|
|
85
|
+
var _activeValuesForLevel;
|
|
86
|
+
if (activeValueForSortBy !== undefined && value === activeValueForSortBy) {
|
|
87
|
+
isActive = true;
|
|
88
|
+
}
|
|
89
|
+
if (activeValueForColorBy !== undefined && value === activeValueForColorBy) {
|
|
90
|
+
isActive = true;
|
|
91
|
+
}
|
|
92
|
+
if ((_activeValuesForLevel = activeValuesForLevel === null || activeValuesForLevel === void 0 ? void 0 : activeValuesForLevel.includes(value !== null && value !== void 0 ? value : '')) !== null && _activeValuesForLevel !== void 0 ? _activeValuesForLevel : false) {
|
|
93
|
+
isActive = true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
var handleSelect = function handleSelect() {
|
|
97
|
+
if (items === undefined) {
|
|
98
|
+
if (onclick !== undefined) {
|
|
99
|
+
onclick();
|
|
100
|
+
closeDropdown();
|
|
101
|
+
} else {
|
|
102
|
+
_onSelect([].concat(_toConsumableArray(path), [label]));
|
|
103
|
+
closeDropdown();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return /*#__PURE__*/_jsx("div", {
|
|
108
|
+
className: "relative",
|
|
109
|
+
ref: menuRef,
|
|
110
|
+
children: /*#__PURE__*/_jsx(Menu, {
|
|
111
|
+
children: function children(_ref2) {
|
|
112
|
+
var close = _ref2.close;
|
|
113
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
114
|
+
children: [/*#__PURE__*/_jsxs(Menu.Button, {
|
|
115
|
+
as: renderAsDiv ? 'div' : 'button',
|
|
116
|
+
className: "w-full text-left px-4 py-2 text-sm ".concat(disabled ? 'text-gray-400' : isActive ? 'text-white bg-indigo-400 hover:text-white' : 'text-white-600 hover:bg-indigo-600 hover:text-white', " flex justify-between items-center"),
|
|
117
|
+
onClick: handleSelect,
|
|
118
|
+
id: id,
|
|
119
|
+
disabled: disabled,
|
|
120
|
+
children: [customSubmenu !== undefined ? customSubmenu : /*#__PURE__*/_jsxs("span", {
|
|
121
|
+
className: "flex items-center",
|
|
122
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
123
|
+
className: "flex items-center gap-2",
|
|
124
|
+
children: [icon !== undefined && /*#__PURE__*/_jsx(Icon, {
|
|
125
|
+
icon: icon,
|
|
126
|
+
className: "h-4 w-4"
|
|
127
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
128
|
+
children: label
|
|
129
|
+
})]
|
|
130
|
+
}), isActive && /*#__PURE__*/_jsx(Icon, {
|
|
131
|
+
icon: "heroicons-solid:check",
|
|
132
|
+
className: "ml-2 h-4 w-4"
|
|
133
|
+
})]
|
|
134
|
+
}), items !== undefined && /*#__PURE__*/_jsx(Icon, {
|
|
135
|
+
icon: "flowbite:caret-right-solid",
|
|
136
|
+
className: "h-[14px] w-[14px]"
|
|
137
|
+
})]
|
|
138
|
+
}), items !== undefined && /*#__PURE__*/_jsx(Menu.Items, {
|
|
139
|
+
className: "absolute top-0 w-56 mt-0 bg-white border border-gray-200 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-gray-900 dark:border-gray-600 ".concat(shouldOpenLeft ? 'right-full mr-1 origin-top-left' : 'left-full ml-1 origin-top-right'),
|
|
140
|
+
children: items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
141
|
+
return /*#__PURE__*/_jsx(_MenuItem, _objectSpread(_objectSpread({}, item), {}, {
|
|
142
|
+
onSelect: function onSelect(selectedPath) {
|
|
143
|
+
_onSelect([].concat(_toConsumableArray(path), _toConsumableArray(selectedPath)));
|
|
144
|
+
close();
|
|
145
|
+
closeDropdown();
|
|
146
|
+
},
|
|
147
|
+
path: [].concat(_toConsumableArray(path), [label]),
|
|
148
|
+
closeDropdown: closeDropdown,
|
|
149
|
+
isNested: true,
|
|
150
|
+
activeValueForSortBy: activeValueForSortBy,
|
|
151
|
+
activeValueForColorBy: activeValueForColorBy,
|
|
152
|
+
activeValuesForLevel: activeValuesForLevel
|
|
153
|
+
}), index);
|
|
154
|
+
})
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
var MultiLevelDropdown = function MultiLevelDropdown(t0) {
|
|
162
|
+
var $ = _c(94);
|
|
163
|
+
var onSelect = t0.onSelect,
|
|
164
|
+
profileType = t0.profileType,
|
|
165
|
+
groupBy = t0.groupBy,
|
|
166
|
+
toggleGroupBy = t0.toggleGroupBy,
|
|
167
|
+
isTableVizOnly = t0.isTableVizOnly,
|
|
168
|
+
alignFunctionName = t0.alignFunctionName,
|
|
169
|
+
setAlignFunctionName = t0.setAlignFunctionName,
|
|
170
|
+
colorBy = t0.colorBy,
|
|
171
|
+
setColorBy = t0.setColorBy;
|
|
172
|
+
var dropdownRef = useRef(null);
|
|
173
|
+
var _useState3 = useState(false),
|
|
174
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
175
|
+
shouldOpenLeft = _useState4[0],
|
|
176
|
+
setShouldOpenLeft = _useState4[1];
|
|
177
|
+
var t1;
|
|
178
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
179
|
+
t1 = {
|
|
180
|
+
defaultValue: FIELD_FUNCTION_NAME
|
|
181
|
+
};
|
|
182
|
+
$[0] = t1;
|
|
183
|
+
} else {
|
|
184
|
+
t1 = $[0];
|
|
185
|
+
}
|
|
186
|
+
var _useURLState = useURLState("sort_by", t1),
|
|
187
|
+
_useURLState2 = _slicedToArray(_useURLState, 1),
|
|
188
|
+
storeSortBy = _useURLState2[0];
|
|
189
|
+
var _useURLState3 = useURLState("color_stack_legend"),
|
|
190
|
+
_useURLState4 = _slicedToArray(_useURLState3, 2),
|
|
191
|
+
colorStackLegend = _useURLState4[0],
|
|
192
|
+
setStoreColorStackLegend = _useURLState4[1];
|
|
193
|
+
var t2;
|
|
194
|
+
if ($[1] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
195
|
+
t2 = {
|
|
196
|
+
defaultValue: [],
|
|
197
|
+
alwaysReturnArray: true
|
|
198
|
+
};
|
|
199
|
+
$[1] = t2;
|
|
200
|
+
} else {
|
|
201
|
+
t2 = $[1];
|
|
202
|
+
}
|
|
203
|
+
var _useURLState5 = useURLState("hidden_binaries", t2),
|
|
204
|
+
_useURLState6 = _slicedToArray(_useURLState5, 2),
|
|
205
|
+
hiddenBinaries = _useURLState6[0],
|
|
206
|
+
setHiddenBinaries = _useURLState6[1];
|
|
207
|
+
var _useProfileViewContex = useProfileViewContext(),
|
|
208
|
+
compareMode = _useProfileViewContex.compareMode;
|
|
209
|
+
var _useUserPreference = useUserPreference(USER_PREFERENCES.FLAMEGRAPH_COLOR_PROFILE.key),
|
|
210
|
+
_useUserPreference2 = _slicedToArray(_useUserPreference, 1),
|
|
211
|
+
colorProfileName = _useUserPreference2[0];
|
|
212
|
+
var isColorStackLegendEnabled = colorStackLegend === "true";
|
|
213
|
+
var isLeftAligned = alignFunctionName === "left";
|
|
214
|
+
var compareAbsoluteDefault = (profileType === null || profileType === void 0 ? void 0 : profileType.delta) === false ? "true" : "false";
|
|
215
|
+
var _useURLState7 = useURLState("compare_absolute"),
|
|
216
|
+
_useURLState8 = _slicedToArray(_useURLState7, 2),
|
|
217
|
+
t3 = _useURLState8[0],
|
|
218
|
+
setCompareAbsolute = _useURLState8[1];
|
|
219
|
+
var compareAbsolute = t3 === undefined ? compareAbsoluteDefault : t3;
|
|
220
|
+
var isCompareAbsolute = compareAbsolute === "true";
|
|
221
|
+
var t4;
|
|
222
|
+
var t5;
|
|
223
|
+
if ($[2] !== isTableVizOnly) {
|
|
224
|
+
t4 = function t4() {
|
|
225
|
+
var checkOverflow = function checkOverflow() {
|
|
226
|
+
if (dropdownRef.current !== null) {
|
|
227
|
+
var rect = dropdownRef.current.getBoundingClientRect();
|
|
228
|
+
var viewportWidth = window.innerWidth;
|
|
229
|
+
var menuWidth = isTableVizOnly ? 256 : 320;
|
|
230
|
+
var spaceOnRight = viewportWidth - rect.right;
|
|
231
|
+
var spaceOnLeft = rect.left;
|
|
232
|
+
setShouldOpenLeft(spaceOnRight < menuWidth && spaceOnLeft >= menuWidth);
|
|
60
233
|
}
|
|
234
|
+
};
|
|
235
|
+
checkOverflow();
|
|
236
|
+
window.addEventListener("resize", checkOverflow);
|
|
237
|
+
return function () {
|
|
238
|
+
return window.removeEventListener("resize", checkOverflow);
|
|
239
|
+
};
|
|
61
240
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
241
|
+
t5 = [isTableVizOnly];
|
|
242
|
+
$[2] = isTableVizOnly;
|
|
243
|
+
$[3] = t4;
|
|
244
|
+
$[4] = t5;
|
|
245
|
+
} else {
|
|
246
|
+
t4 = $[3];
|
|
247
|
+
t5 = $[4];
|
|
248
|
+
}
|
|
249
|
+
useEffect(t4, t5);
|
|
250
|
+
var t6;
|
|
251
|
+
if ($[5] !== hiddenBinaries || $[6] !== setHiddenBinaries) {
|
|
252
|
+
t6 = function t6(index) {
|
|
253
|
+
var updatedBinaries = _toConsumableArray(hiddenBinaries);
|
|
254
|
+
updatedBinaries.splice(index, 1);
|
|
255
|
+
setHiddenBinaries(updatedBinaries);
|
|
256
|
+
};
|
|
257
|
+
$[5] = hiddenBinaries;
|
|
258
|
+
$[6] = setHiddenBinaries;
|
|
259
|
+
$[7] = t6;
|
|
260
|
+
} else {
|
|
261
|
+
t6 = $[7];
|
|
262
|
+
}
|
|
263
|
+
var handleBinaryToggle = t6;
|
|
264
|
+
var t7;
|
|
265
|
+
if ($[8] !== setStoreColorStackLegend) {
|
|
266
|
+
t7 = function t7(value) {
|
|
267
|
+
setStoreColorStackLegend(value);
|
|
268
|
+
};
|
|
269
|
+
$[8] = setStoreColorStackLegend;
|
|
270
|
+
$[9] = t7;
|
|
271
|
+
} else {
|
|
272
|
+
t7 = $[9];
|
|
273
|
+
}
|
|
274
|
+
var setColorStackLegend = t7;
|
|
275
|
+
var t8;
|
|
276
|
+
if ($[10] !== setHiddenBinaries) {
|
|
277
|
+
t8 = function t8() {
|
|
278
|
+
setHiddenBinaries([]);
|
|
279
|
+
};
|
|
280
|
+
$[10] = setHiddenBinaries;
|
|
281
|
+
$[11] = t8;
|
|
282
|
+
} else {
|
|
283
|
+
t8 = $[11];
|
|
284
|
+
}
|
|
285
|
+
var resetLegend = t8;
|
|
286
|
+
var t9;
|
|
287
|
+
if ($[12] !== toggleGroupBy) {
|
|
288
|
+
t9 = {
|
|
289
|
+
label: "Function",
|
|
290
|
+
onclick: function onclick() {
|
|
291
|
+
return toggleGroupBy(FIELD_FUNCTION_NAME);
|
|
292
|
+
},
|
|
293
|
+
value: FIELD_FUNCTION_NAME
|
|
294
|
+
};
|
|
295
|
+
$[12] = toggleGroupBy;
|
|
296
|
+
$[13] = t9;
|
|
297
|
+
} else {
|
|
298
|
+
t9 = $[13];
|
|
299
|
+
}
|
|
300
|
+
var t10;
|
|
301
|
+
if ($[14] !== toggleGroupBy) {
|
|
302
|
+
t10 = {
|
|
303
|
+
label: "Binary",
|
|
304
|
+
onclick: function onclick() {
|
|
305
|
+
return toggleGroupBy(FIELD_MAPPING_FILE);
|
|
306
|
+
},
|
|
307
|
+
value: FIELD_MAPPING_FILE
|
|
308
|
+
};
|
|
309
|
+
$[14] = toggleGroupBy;
|
|
310
|
+
$[15] = t10;
|
|
311
|
+
} else {
|
|
312
|
+
t10 = $[15];
|
|
313
|
+
}
|
|
314
|
+
var t11;
|
|
315
|
+
if ($[16] !== toggleGroupBy) {
|
|
316
|
+
t11 = {
|
|
317
|
+
label: "Code",
|
|
318
|
+
onclick: function onclick() {
|
|
319
|
+
return toggleGroupBy(FIELD_FUNCTION_FILE_NAME);
|
|
320
|
+
},
|
|
321
|
+
value: FIELD_FUNCTION_FILE_NAME
|
|
322
|
+
};
|
|
323
|
+
$[16] = toggleGroupBy;
|
|
324
|
+
$[17] = t11;
|
|
325
|
+
} else {
|
|
326
|
+
t11 = $[17];
|
|
327
|
+
}
|
|
328
|
+
var t12;
|
|
329
|
+
if ($[18] !== toggleGroupBy) {
|
|
330
|
+
t12 = {
|
|
331
|
+
label: "Address",
|
|
332
|
+
onclick: function onclick() {
|
|
333
|
+
return toggleGroupBy(FIELD_LOCATION_ADDRESS);
|
|
334
|
+
},
|
|
335
|
+
value: FIELD_LOCATION_ADDRESS
|
|
336
|
+
};
|
|
337
|
+
$[18] = toggleGroupBy;
|
|
338
|
+
$[19] = t12;
|
|
339
|
+
} else {
|
|
340
|
+
t12 = $[19];
|
|
341
|
+
}
|
|
342
|
+
var t13;
|
|
343
|
+
if ($[20] !== t10 || $[21] !== t11 || $[22] !== t12 || $[23] !== t9) {
|
|
344
|
+
t13 = [t9, t10, t11, t12];
|
|
345
|
+
$[20] = t10;
|
|
346
|
+
$[21] = t11;
|
|
347
|
+
$[22] = t12;
|
|
348
|
+
$[23] = t9;
|
|
349
|
+
$[24] = t13;
|
|
350
|
+
} else {
|
|
351
|
+
t13 = $[24];
|
|
352
|
+
}
|
|
353
|
+
var t14 = !!isTableVizOnly;
|
|
354
|
+
var t15;
|
|
355
|
+
if ($[25] !== t13 || $[26] !== t14) {
|
|
356
|
+
t15 = {
|
|
357
|
+
label: "Levels",
|
|
358
|
+
id: "h-levels-filter",
|
|
359
|
+
items: t13,
|
|
360
|
+
hide: t14,
|
|
361
|
+
icon: "heroicons-solid:bars-3"
|
|
362
|
+
};
|
|
363
|
+
$[25] = t13;
|
|
364
|
+
$[26] = t14;
|
|
365
|
+
$[27] = t15;
|
|
366
|
+
} else {
|
|
367
|
+
t15 = $[27];
|
|
368
|
+
}
|
|
369
|
+
var t16;
|
|
370
|
+
if ($[28] !== setColorBy) {
|
|
371
|
+
t16 = {
|
|
372
|
+
label: "Binary",
|
|
373
|
+
onclick: function onclick() {
|
|
374
|
+
return setColorBy("binary");
|
|
375
|
+
},
|
|
376
|
+
value: "binary"
|
|
377
|
+
};
|
|
378
|
+
$[28] = setColorBy;
|
|
379
|
+
$[29] = t16;
|
|
380
|
+
} else {
|
|
381
|
+
t16 = $[29];
|
|
382
|
+
}
|
|
383
|
+
var t17;
|
|
384
|
+
if ($[30] !== setColorBy) {
|
|
385
|
+
t17 = {
|
|
386
|
+
label: "Filename",
|
|
387
|
+
onclick: function onclick() {
|
|
388
|
+
return setColorBy("filename");
|
|
389
|
+
},
|
|
390
|
+
value: "filename"
|
|
391
|
+
};
|
|
392
|
+
$[30] = setColorBy;
|
|
393
|
+
$[31] = t17;
|
|
394
|
+
} else {
|
|
395
|
+
t17 = $[31];
|
|
396
|
+
}
|
|
397
|
+
var t18;
|
|
398
|
+
if ($[32] !== t16 || $[33] !== t17) {
|
|
399
|
+
t18 = {
|
|
400
|
+
label: "Color by",
|
|
401
|
+
id: "h-color-by-filter",
|
|
402
|
+
items: [t16, t17],
|
|
403
|
+
hide: false,
|
|
404
|
+
icon: "carbon:color-palette"
|
|
405
|
+
};
|
|
406
|
+
$[32] = t16;
|
|
407
|
+
$[33] = t17;
|
|
408
|
+
$[34] = t18;
|
|
409
|
+
} else {
|
|
410
|
+
t18 = $[34];
|
|
411
|
+
}
|
|
412
|
+
var t19 = isColorStackLegendEnabled ? "Hide legend" : "Show legend";
|
|
413
|
+
var t20;
|
|
414
|
+
if ($[35] !== isColorStackLegendEnabled || $[36] !== setColorStackLegend) {
|
|
415
|
+
t20 = function t20() {
|
|
416
|
+
return setColorStackLegend(isColorStackLegendEnabled ? "false" : "true");
|
|
417
|
+
};
|
|
418
|
+
$[35] = isColorStackLegendEnabled;
|
|
419
|
+
$[36] = setColorStackLegend;
|
|
420
|
+
$[37] = t20;
|
|
421
|
+
} else {
|
|
422
|
+
t20 = $[37];
|
|
423
|
+
}
|
|
424
|
+
var t21 = compareMode || colorProfileName === "default";
|
|
425
|
+
var t22 = isColorStackLegendEnabled ? "ph:eye-closed" : "ph:eye";
|
|
426
|
+
var t23;
|
|
427
|
+
if ($[38] !== t19 || $[39] !== t20 || $[40] !== t21 || $[41] !== t22) {
|
|
428
|
+
t23 = {
|
|
429
|
+
label: t19,
|
|
430
|
+
onclick: t20,
|
|
431
|
+
hide: t21,
|
|
432
|
+
id: "h-show-legend-button",
|
|
433
|
+
icon: t22
|
|
434
|
+
};
|
|
435
|
+
$[38] = t19;
|
|
436
|
+
$[39] = t20;
|
|
437
|
+
$[40] = t21;
|
|
438
|
+
$[41] = t22;
|
|
439
|
+
$[42] = t23;
|
|
440
|
+
} else {
|
|
441
|
+
t23 = $[42];
|
|
442
|
+
}
|
|
443
|
+
var t24 = isLeftAligned ? "Right-align function names" : "Left-align function names";
|
|
444
|
+
var t25;
|
|
445
|
+
if ($[43] !== isLeftAligned || $[44] !== setAlignFunctionName) {
|
|
446
|
+
t25 = function t25() {
|
|
447
|
+
return setAlignFunctionName(isLeftAligned ? "right" : "left");
|
|
448
|
+
};
|
|
449
|
+
$[43] = isLeftAligned;
|
|
450
|
+
$[44] = setAlignFunctionName;
|
|
451
|
+
$[45] = t25;
|
|
452
|
+
} else {
|
|
453
|
+
t25 = $[45];
|
|
454
|
+
}
|
|
455
|
+
var t26 = !!isTableVizOnly;
|
|
456
|
+
var t27 = isLeftAligned ? "ic:outline-align-horizontal-right" : "ic:outline-align-horizontal-left";
|
|
457
|
+
var t28;
|
|
458
|
+
if ($[46] !== t24 || $[47] !== t25 || $[48] !== t26 || $[49] !== t27) {
|
|
459
|
+
t28 = {
|
|
460
|
+
label: t24,
|
|
461
|
+
onclick: t25,
|
|
462
|
+
id: "h-align-function-names",
|
|
463
|
+
hide: t26,
|
|
464
|
+
icon: t27
|
|
465
|
+
};
|
|
466
|
+
$[46] = t24;
|
|
467
|
+
$[47] = t25;
|
|
468
|
+
$[48] = t26;
|
|
469
|
+
$[49] = t27;
|
|
470
|
+
$[50] = t28;
|
|
471
|
+
} else {
|
|
472
|
+
t28 = $[50];
|
|
473
|
+
}
|
|
474
|
+
var t29 = isCompareAbsolute ? "Compare Relative" : "Compare Absolute";
|
|
475
|
+
var t30;
|
|
476
|
+
if ($[51] !== isCompareAbsolute || $[52] !== setCompareAbsolute) {
|
|
477
|
+
t30 = function t30() {
|
|
478
|
+
return setCompareAbsolute(isCompareAbsolute ? "false" : "true");
|
|
479
|
+
};
|
|
480
|
+
$[51] = isCompareAbsolute;
|
|
481
|
+
$[52] = setCompareAbsolute;
|
|
482
|
+
$[53] = t30;
|
|
483
|
+
} else {
|
|
484
|
+
t30 = $[53];
|
|
485
|
+
}
|
|
486
|
+
var t31 = !compareMode;
|
|
487
|
+
var t32 = isCompareAbsolute ? "fluent-mdl2:compare" : "fluent-mdl2:compare-uneven";
|
|
488
|
+
var t33;
|
|
489
|
+
if ($[54] !== t29 || $[55] !== t30 || $[56] !== t31 || $[57] !== t32) {
|
|
490
|
+
t33 = {
|
|
491
|
+
label: t29,
|
|
492
|
+
onclick: t30,
|
|
493
|
+
hide: t31,
|
|
494
|
+
icon: t32
|
|
495
|
+
};
|
|
496
|
+
$[54] = t29;
|
|
497
|
+
$[55] = t30;
|
|
498
|
+
$[56] = t31;
|
|
499
|
+
$[57] = t32;
|
|
500
|
+
$[58] = t33;
|
|
501
|
+
} else {
|
|
502
|
+
t33 = $[58];
|
|
503
|
+
}
|
|
504
|
+
var t34 = !!isTableVizOnly;
|
|
505
|
+
var t35;
|
|
506
|
+
if ($[59] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
507
|
+
t35 = /*#__PURE__*/_jsx(SwitchMenuItem, {
|
|
508
|
+
label: "Dock graph tooltip",
|
|
509
|
+
id: "h-dock-graph-meta-info",
|
|
510
|
+
userPreferenceDetails: USER_PREFERENCES.GRAPH_METAINFO_DOCKED
|
|
511
|
+
});
|
|
512
|
+
$[59] = t35;
|
|
513
|
+
} else {
|
|
514
|
+
t35 = $[59];
|
|
515
|
+
}
|
|
516
|
+
var t36;
|
|
517
|
+
if ($[60] !== t34) {
|
|
518
|
+
t36 = {
|
|
519
|
+
label: "Dock Graph MetaInfo",
|
|
520
|
+
hide: t34,
|
|
521
|
+
customSubmenu: t35,
|
|
522
|
+
renderAsDiv: true
|
|
523
|
+
};
|
|
524
|
+
$[60] = t34;
|
|
525
|
+
$[61] = t36;
|
|
526
|
+
} else {
|
|
527
|
+
t36 = $[61];
|
|
528
|
+
}
|
|
529
|
+
var t37 = !!isTableVizOnly;
|
|
530
|
+
var t38;
|
|
531
|
+
if ($[62] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
532
|
+
t38 = /*#__PURE__*/_jsx(SwitchMenuItem, {
|
|
533
|
+
label: "Highlight similar stacks when hovering over a node",
|
|
534
|
+
id: "h-highlight-similar-stacks",
|
|
535
|
+
userPreferenceDetails: USER_PREFERENCES.HIGHLIGHT_SIMILAR_STACKS
|
|
536
|
+
});
|
|
537
|
+
$[62] = t38;
|
|
538
|
+
} else {
|
|
539
|
+
t38 = $[62];
|
|
540
|
+
}
|
|
541
|
+
var t39;
|
|
542
|
+
if ($[63] !== t37) {
|
|
543
|
+
t39 = {
|
|
544
|
+
label: "Highlight similar stacks when hovering over a node",
|
|
545
|
+
hide: t37,
|
|
546
|
+
customSubmenu: t38,
|
|
547
|
+
renderAsDiv: true
|
|
548
|
+
};
|
|
549
|
+
$[63] = t37;
|
|
550
|
+
$[64] = t39;
|
|
551
|
+
} else {
|
|
552
|
+
t39 = $[64];
|
|
553
|
+
}
|
|
554
|
+
var t40 = hiddenBinaries === undefined || hiddenBinaries.length === 0;
|
|
555
|
+
var t41;
|
|
556
|
+
if ($[65] !== resetLegend) {
|
|
557
|
+
t41 = function t41() {
|
|
558
|
+
return resetLegend();
|
|
559
|
+
};
|
|
560
|
+
$[65] = resetLegend;
|
|
561
|
+
$[66] = t41;
|
|
562
|
+
} else {
|
|
563
|
+
t41 = $[66];
|
|
564
|
+
}
|
|
565
|
+
var t42;
|
|
566
|
+
if ($[67] !== t40 || $[68] !== t41) {
|
|
567
|
+
t42 = {
|
|
568
|
+
label: "Reset Legend",
|
|
569
|
+
hide: t40,
|
|
570
|
+
onclick: t41,
|
|
571
|
+
id: "h-reset-legend-button",
|
|
572
|
+
icon: "system-uicons:reset"
|
|
573
|
+
};
|
|
574
|
+
$[67] = t40;
|
|
575
|
+
$[68] = t41;
|
|
576
|
+
$[69] = t42;
|
|
577
|
+
} else {
|
|
578
|
+
t42 = $[69];
|
|
579
|
+
}
|
|
580
|
+
var t43;
|
|
581
|
+
if ($[70] !== handleBinaryToggle || $[71] !== hiddenBinaries) {
|
|
582
|
+
t43 = hiddenBinaries === null || hiddenBinaries === void 0 ? void 0 : hiddenBinaries.map(function (binary, index_0) {
|
|
583
|
+
return {
|
|
584
|
+
label: binary,
|
|
585
|
+
customSubmenu: /*#__PURE__*/_jsxs("div", {
|
|
586
|
+
className: "flex items-center gap-2 w-full",
|
|
587
|
+
children: [/*#__PURE__*/_jsx("input", {
|
|
588
|
+
id: binary,
|
|
589
|
+
name: binary,
|
|
590
|
+
type: "checkbox",
|
|
591
|
+
className: "h-4 w-4 rounded-md border-2 border-gray-300 text-indigo-600 focus:ring-indigo-600 focus:ring-offset-0 checked:bg-indigo-600 checked:border-indigo-600",
|
|
592
|
+
checked: hiddenBinaries === null || hiddenBinaries === void 0 ? void 0 : hiddenBinaries.includes(binary),
|
|
593
|
+
onChange: function onChange() {
|
|
594
|
+
return handleBinaryToggle(index_0);
|
|
98
595
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
icon: 'system-uicons:reset',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
label: 'Hidden Binaries',
|
|
205
|
-
id: 'h-hidden-binaries',
|
|
206
|
-
items: hiddenBinaries.map((binary, index) => ({
|
|
207
|
-
label: binary,
|
|
208
|
-
customSubmenu: (_jsxs("div", { className: "flex items-center gap-2 w-full", children: [_jsx("input", { id: binary, name: binary, type: "checkbox", className: "h-4 w-4 rounded-md border-2 border-gray-300 text-indigo-600 focus:ring-indigo-600 focus:ring-offset-0 checked:bg-indigo-600 checked:border-indigo-600", checked: hiddenBinaries?.includes(binary), onChange: () => handleBinaryToggle(index) }), _jsx("span", { children: binary })] })),
|
|
209
|
-
})),
|
|
210
|
-
hide: hiddenBinaries.length === 0,
|
|
211
|
-
icon: 'ph:eye-closed',
|
|
212
|
-
},
|
|
213
|
-
];
|
|
214
|
-
return (_jsx("div", { className: "relative inline-block text-left", id: "h-visualisation-toolbar-actions", ref: dropdownRef, children: _jsx(Menu, { children: ({ open, close }) => (_jsxs(_Fragment, { children: [_jsxs(Menu.Button, { className: "flex dark:bg-gray-900 dark:border-gray-600 justify-center w-full px-4 py-2 text-sm font-normal text-gray-600 dark:text-gray-200 bg-white rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 border border-gray-200 pr-[1.7rem]", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Icon, { icon: "pajamas:preferences", className: "w-4 h-4" }), _jsx("span", { children: "Preferences" })] }), _jsx("span", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-gray-400", children: _jsx(Icon, { icon: "heroicons:chevron-down-20-solid", "aria-hidden": "true" }) })] }), open && (_jsx(Menu.Items, { className: cx(isTableVizOnly ? 'w-64' : 'w-80', 'absolute z-50 mt-2 py-2 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none border dark:bg-gray-900 dark:border-gray-600', shouldOpenLeft ? 'right-0 origin-top-right' : 'left-0 origin-top-left'), children: menuItems
|
|
215
|
-
.filter(item => item.hide !== undefined && !item.hide)
|
|
216
|
-
.map((item, index) => (_jsx(MenuItem, { ...item, onSelect: onSelect, closeDropdown: close, activeValueForSortBy: storeSortBy, activeValueForColorBy: colorBy, activeValuesForLevel: groupBy, renderAsDiv: item.renderAsDiv }, index))) }))] })) }) }));
|
|
596
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
597
|
+
children: binary
|
|
598
|
+
})]
|
|
599
|
+
})
|
|
600
|
+
};
|
|
601
|
+
});
|
|
602
|
+
$[70] = handleBinaryToggle;
|
|
603
|
+
$[71] = hiddenBinaries;
|
|
604
|
+
$[72] = t43;
|
|
605
|
+
} else {
|
|
606
|
+
t43 = $[72];
|
|
607
|
+
}
|
|
608
|
+
var t44 = hiddenBinaries === undefined || hiddenBinaries.length === 0;
|
|
609
|
+
var t45;
|
|
610
|
+
if ($[73] !== t43 || $[74] !== t44) {
|
|
611
|
+
t45 = {
|
|
612
|
+
label: "Hidden Binaries",
|
|
613
|
+
id: "h-hidden-binaries",
|
|
614
|
+
items: t43,
|
|
615
|
+
hide: t44,
|
|
616
|
+
icon: "ph:eye-closed"
|
|
617
|
+
};
|
|
618
|
+
$[73] = t43;
|
|
619
|
+
$[74] = t44;
|
|
620
|
+
$[75] = t45;
|
|
621
|
+
} else {
|
|
622
|
+
t45 = $[75];
|
|
623
|
+
}
|
|
624
|
+
var t46;
|
|
625
|
+
if ($[76] !== t15 || $[77] !== t18 || $[78] !== t23 || $[79] !== t28 || $[80] !== t33 || $[81] !== t36 || $[82] !== t39 || $[83] !== t42 || $[84] !== t45) {
|
|
626
|
+
t46 = [t15, t18, t23, t28, t33, t36, t39, t42, t45];
|
|
627
|
+
$[76] = t15;
|
|
628
|
+
$[77] = t18;
|
|
629
|
+
$[78] = t23;
|
|
630
|
+
$[79] = t28;
|
|
631
|
+
$[80] = t33;
|
|
632
|
+
$[81] = t36;
|
|
633
|
+
$[82] = t39;
|
|
634
|
+
$[83] = t42;
|
|
635
|
+
$[84] = t45;
|
|
636
|
+
$[85] = t46;
|
|
637
|
+
} else {
|
|
638
|
+
t46 = $[85];
|
|
639
|
+
}
|
|
640
|
+
var menuItems = t46;
|
|
641
|
+
var t47;
|
|
642
|
+
if ($[86] !== colorBy || $[87] !== groupBy || $[88] !== isTableVizOnly || $[89] !== menuItems || $[90] !== onSelect || $[91] !== shouldOpenLeft || $[92] !== storeSortBy) {
|
|
643
|
+
t47 = /*#__PURE__*/_jsx("div", {
|
|
644
|
+
className: "relative inline-block text-left",
|
|
645
|
+
id: "h-visualisation-toolbar-actions",
|
|
646
|
+
ref: dropdownRef,
|
|
647
|
+
children: /*#__PURE__*/_jsx(Menu, {
|
|
648
|
+
children: function children(t48) {
|
|
649
|
+
var open = t48.open,
|
|
650
|
+
close = t48.close;
|
|
651
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
652
|
+
children: [/*#__PURE__*/_jsxs(Menu.Button, {
|
|
653
|
+
className: "flex dark:bg-gray-900 dark:border-gray-600 justify-center w-full px-4 py-2 text-sm font-normal text-gray-600 dark:text-gray-200 bg-white rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 border border-gray-200 pr-[1.7rem]",
|
|
654
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
655
|
+
className: "flex items-center gap-2",
|
|
656
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
657
|
+
icon: "pajamas:preferences",
|
|
658
|
+
className: "w-4 h-4"
|
|
659
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
660
|
+
children: "Preferences"
|
|
661
|
+
})]
|
|
662
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
663
|
+
className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-gray-400",
|
|
664
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
665
|
+
icon: "heroicons:chevron-down-20-solid",
|
|
666
|
+
"aria-hidden": "true"
|
|
667
|
+
})
|
|
668
|
+
})]
|
|
669
|
+
}), open && /*#__PURE__*/_jsx(Menu.Items, {
|
|
670
|
+
className: cx(isTableVizOnly ? "w-64" : "w-80", "absolute z-50 mt-2 py-2 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none border dark:bg-gray-900 dark:border-gray-600", shouldOpenLeft ? "right-0 origin-top-right" : "left-0 origin-top-left"),
|
|
671
|
+
children: menuItems.filter(_temp).map(function (item_0, index_1) {
|
|
672
|
+
return /*#__PURE__*/_jsx(_MenuItem, _objectSpread(_objectSpread({}, item_0), {}, {
|
|
673
|
+
onSelect: onSelect,
|
|
674
|
+
closeDropdown: close,
|
|
675
|
+
activeValueForSortBy: storeSortBy,
|
|
676
|
+
activeValueForColorBy: colorBy === undefined || colorBy === "" ? "binary" : colorBy,
|
|
677
|
+
activeValuesForLevel: groupBy,
|
|
678
|
+
renderAsDiv: item_0.renderAsDiv
|
|
679
|
+
}), index_1);
|
|
680
|
+
})
|
|
681
|
+
})]
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
})
|
|
685
|
+
});
|
|
686
|
+
$[86] = colorBy;
|
|
687
|
+
$[87] = groupBy;
|
|
688
|
+
$[88] = isTableVizOnly;
|
|
689
|
+
$[89] = menuItems;
|
|
690
|
+
$[90] = onSelect;
|
|
691
|
+
$[91] = shouldOpenLeft;
|
|
692
|
+
$[92] = storeSortBy;
|
|
693
|
+
$[93] = t47;
|
|
694
|
+
} else {
|
|
695
|
+
t47 = $[93];
|
|
696
|
+
}
|
|
697
|
+
return t47;
|
|
217
698
|
};
|
|
218
699
|
export default MultiLevelDropdown;
|
|
700
|
+
function _temp(item) {
|
|
701
|
+
return item.hide !== undefined && !item.hide;
|
|
702
|
+
}
|