@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,15 @@
|
|
|
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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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; } }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
2
13
|
// Copyright 2022 The Parca Authors
|
|
3
14
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
15
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,62 +22,81 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
22
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
23
|
// See the License for the specific language governing permissions and
|
|
13
24
|
// limitations under the License.
|
|
14
|
-
|
|
25
|
+
|
|
26
|
+
/* eslint-disable react-hooks/refs */
|
|
27
|
+
|
|
28
|
+
import React, { useEffect, useState } from 'react';
|
|
15
29
|
import { flip, offset, shift, useFloating } from '@floating-ui/react';
|
|
16
30
|
import { pointer } from 'd3-selection';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
32
|
+
function createPositionedVirtualElement(contextElement) {
|
|
33
|
+
var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
34
|
+
var y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
35
|
+
var domRect = contextElement.getBoundingClientRect();
|
|
36
|
+
return {
|
|
37
|
+
getBoundingClientRect: function getBoundingClientRect() {
|
|
38
|
+
return {
|
|
39
|
+
width: 0,
|
|
40
|
+
height: 0,
|
|
41
|
+
top: domRect.y + y,
|
|
42
|
+
left: domRect.x + x,
|
|
43
|
+
right: domRect.x + x,
|
|
44
|
+
bottom: domRect.y + y,
|
|
45
|
+
x: domRect.x + x,
|
|
46
|
+
y: domRect.y + y,
|
|
47
|
+
toJSON: function toJSON() {
|
|
48
|
+
return {};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
32
53
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
54
|
+
var GraphTooltip = function GraphTooltip(_ref) {
|
|
55
|
+
'use no memo';
|
|
56
|
+
|
|
57
|
+
var children = _ref.children,
|
|
58
|
+
contextElement = _ref.contextElement;
|
|
59
|
+
var _useState = useState(false),
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
isPositioned = _useState2[0],
|
|
62
|
+
setIsPositioned = _useState2[1];
|
|
63
|
+
var _useFloating = useFloating({
|
|
64
|
+
placement: 'bottom-start',
|
|
65
|
+
strategy: 'fixed',
|
|
66
|
+
middleware: [offset({
|
|
67
|
+
mainAxis: 30,
|
|
68
|
+
crossAxis: 30
|
|
69
|
+
}), flip(), shift({
|
|
70
|
+
padding: 20
|
|
71
|
+
})],
|
|
72
|
+
whileElementsMounted: undefined
|
|
73
|
+
}),
|
|
74
|
+
refs = _useFloating.refs,
|
|
75
|
+
floatingStyles = _useFloating.floatingStyles,
|
|
76
|
+
update = _useFloating.update;
|
|
77
|
+
useEffect(function () {
|
|
78
|
+
if (contextElement === null) return;
|
|
79
|
+
var onMouseMove = function onMouseMove(e) {
|
|
80
|
+
var rel = pointer(e);
|
|
81
|
+
var tooltipX = rel[0];
|
|
82
|
+
var tooltipY = rel[1];
|
|
83
|
+
var virtualElement = createPositionedVirtualElement(contextElement, tooltipX, tooltipY);
|
|
84
|
+
refs.setReference(virtualElement);
|
|
85
|
+
setIsPositioned(true);
|
|
86
|
+
update();
|
|
87
|
+
};
|
|
88
|
+
contextElement.addEventListener('mousemove', onMouseMove);
|
|
89
|
+
return function () {
|
|
90
|
+
contextElement.removeEventListener('mousemove', onMouseMove);
|
|
91
|
+
};
|
|
92
|
+
}, [contextElement, update, refs]);
|
|
93
|
+
return /*#__PURE__*/_jsx("div", {
|
|
94
|
+
ref: refs.setFloating,
|
|
95
|
+
style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
|
|
96
|
+
visibility: !isPositioned ? 'hidden' : 'visible'
|
|
97
|
+
}),
|
|
98
|
+
className: "z-50 w-max",
|
|
99
|
+
children: children
|
|
100
|
+
});
|
|
71
101
|
};
|
|
72
|
-
export default GraphTooltip;
|
|
102
|
+
export default GraphTooltip;
|
|
@@ -10,42 +10,42 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
+
|
|
13
14
|
import { divide, valueFormatter } from '@parca/utilities';
|
|
14
|
-
import { FIELD_CUMULATIVE, FIELD_DIFF, FIELD_FLAT, FIELD_LOCATION_ADDRESS
|
|
15
|
+
import { FIELD_CUMULATIVE, FIELD_DIFF, FIELD_FLAT, FIELD_LOCATION_ADDRESS } from '../../ProfileFlameGraph/FlameGraphArrow';
|
|
15
16
|
import { getTextForCumulative, nodeLabel } from '../../ProfileFlameGraph/FlameGraphArrow/utils';
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
17
|
+
export var useGraphTooltip = function useGraphTooltip(_ref) {
|
|
18
|
+
var _table$getChild$get, _table$getChild, _table$getChild2, _table$getChild3, _table$getChild4, _table$getChild5, _table$getChild6, _table$getChild7, _table$getChild8, _table$getChild9, _table$getChild0;
|
|
19
|
+
var table = _ref.table,
|
|
20
|
+
profileType = _ref.profileType,
|
|
21
|
+
unit = _ref.unit,
|
|
22
|
+
compareAbsolute = _ref.compareAbsolute,
|
|
23
|
+
total = _ref.total,
|
|
24
|
+
totalUnfiltered = _ref.totalUnfiltered,
|
|
25
|
+
row = _ref.row;
|
|
26
|
+
if (row === null || profileType === undefined) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
var locationAddress = (_table$getChild$get = (_table$getChild = table.getChild(FIELD_LOCATION_ADDRESS)) === null || _table$getChild === void 0 ? void 0 : _table$getChild.get(row)) !== null && _table$getChild$get !== void 0 ? _table$getChild$get : 0n;
|
|
30
|
+
unit = unit !== null && unit !== void 0 ? unit : profileType.sampleUnit;
|
|
31
|
+
var cumulative = ((_table$getChild2 = table.getChild(FIELD_CUMULATIVE)) === null || _table$getChild2 === void 0 ? void 0 : _table$getChild2.get(row)) !== null && ((_table$getChild3 = table.getChild(FIELD_CUMULATIVE)) === null || _table$getChild3 === void 0 ? void 0 : _table$getChild3.get(row)) !== undefined ? BigInt((_table$getChild4 = table.getChild(FIELD_CUMULATIVE)) === null || _table$getChild4 === void 0 ? void 0 : _table$getChild4.get(row)) : 0n;
|
|
32
|
+
var flat = ((_table$getChild5 = table.getChild(FIELD_FLAT)) === null || _table$getChild5 === void 0 ? void 0 : _table$getChild5.get(row)) !== null && ((_table$getChild6 = table.getChild(FIELD_FLAT)) === null || _table$getChild6 === void 0 ? void 0 : _table$getChild6.get(row)) !== undefined ? BigInt((_table$getChild7 = table.getChild(FIELD_FLAT)) === null || _table$getChild7 === void 0 ? void 0 : _table$getChild7.get(row)) : 0n;
|
|
33
|
+
var diff = ((_table$getChild8 = table.getChild(FIELD_DIFF)) === null || _table$getChild8 === void 0 ? void 0 : _table$getChild8.get(row)) !== null && ((_table$getChild9 = table.getChild(FIELD_DIFF)) === null || _table$getChild9 === void 0 ? void 0 : _table$getChild9.get(row)) !== undefined ? BigInt((_table$getChild0 = table.getChild(FIELD_DIFF)) === null || _table$getChild0 === void 0 ? void 0 : _table$getChild0.get(row)) : 0n;
|
|
34
|
+
var diffText = '';
|
|
35
|
+
var prevValue = cumulative - diff;
|
|
36
|
+
var diffRatio = diff !== 0n ? divide(diff, prevValue) : 0;
|
|
37
|
+
var diffSign = diff > 0 ? '+' : '';
|
|
38
|
+
var diffValueText = diffSign + valueFormatter(diff, unit, 1);
|
|
39
|
+
var diffPercentageText = diffSign + (diffRatio * 100).toFixed(2) + '%';
|
|
40
|
+
diffText = compareAbsolute ? "".concat(diffValueText, " (").concat(diffPercentageText, ")") : diffPercentageText;
|
|
41
|
+
var name = nodeLabel(table, row, false);
|
|
42
|
+
return {
|
|
43
|
+
name: name,
|
|
44
|
+
locationAddress: locationAddress,
|
|
45
|
+
cumulativeText: getTextForCumulative(cumulative, totalUnfiltered, total, unit !== null && unit !== void 0 ? unit : ''),
|
|
46
|
+
flatText: getTextForCumulative(flat, totalUnfiltered, total, unit !== null && unit !== void 0 ? unit : ''),
|
|
47
|
+
diffText: diffText,
|
|
48
|
+
diff: diff,
|
|
49
|
+
row: row
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAqBxC,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,wBAAwB;IAChC,UAAU,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,eAAO,MAAM,uBAAuB,GAAI,gBAAc,KAAK,KAAG,wBA8F7D,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
7
|
// Copyright 2022 The Parca Authors
|
|
2
8
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
9
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,79 +16,105 @@
|
|
|
10
16
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
17
|
// See the License for the specific language governing permissions and
|
|
12
18
|
// limitations under the License.
|
|
13
|
-
|
|
19
|
+
|
|
14
20
|
import { QueryRequest_ReportType } from '@parca/client';
|
|
15
|
-
import { useParcaContext } from '@parca/components';
|
|
16
|
-
import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_START_LINE, FIELD_FUNCTION_SYSTEM_NAME, FIELD_INLINED, FIELD_LOCATION_ADDRESS, FIELD_LOCATION_LINE, FIELD_MAPPING_BUILD_ID, FIELD_MAPPING_FILE, FIELD_TIMESTAMP
|
|
21
|
+
import { useParcaContext, useURLState } from '@parca/components';
|
|
22
|
+
import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_START_LINE, FIELD_FUNCTION_SYSTEM_NAME, FIELD_INLINED, FIELD_LOCATION_ADDRESS, FIELD_LOCATION_LINE, FIELD_MAPPING_BUILD_ID, FIELD_MAPPING_FILE, FIELD_TIMESTAMP } from '../../ProfileFlameGraph/FlameGraphArrow';
|
|
17
23
|
import { arrowToString } from '../../ProfileFlameGraph/FlameGraphArrow/utils';
|
|
18
24
|
import { useProfileViewContext } from '../../ProfileView/context/ProfileViewContext';
|
|
19
|
-
import { stringParam } from '../../hooks/urlParsers';
|
|
20
|
-
import { useDashboardItems } from '../../hooks/useDashboardItems';
|
|
21
25
|
import { useQuery } from '../../useQuery';
|
|
22
|
-
export
|
|
23
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
26
|
+
export var useGraphTooltipMetaInfo = function useGraphTooltipMetaInfo(_ref) {
|
|
27
|
+
var _table$getChild, _table$getChild2, _table$getChild$get, _table$getChild3, _table$getChild4, _table$getChild$get2, _table$getChild5, _arrowToString, _table$getChild6, _arrowToString2, _table$getChild7, _table$getChild$get3, _table$getChild8, _table$getChild9;
|
|
28
|
+
var table = _ref.table,
|
|
29
|
+
row = _ref.row;
|
|
30
|
+
var mappingFile = arrowToString((_table$getChild = table.getChild(FIELD_MAPPING_FILE)) === null || _table$getChild === void 0 ? void 0 : _table$getChild.get(row));
|
|
31
|
+
var mappingBuildID = arrowToString((_table$getChild2 = table.getChild(FIELD_MAPPING_BUILD_ID)) === null || _table$getChild2 === void 0 ? void 0 : _table$getChild2.get(row));
|
|
32
|
+
var locationAddress = (_table$getChild$get = (_table$getChild3 = table.getChild(FIELD_LOCATION_ADDRESS)) === null || _table$getChild3 === void 0 ? void 0 : _table$getChild3.get(row)) !== null && _table$getChild$get !== void 0 ? _table$getChild$get : 0n;
|
|
33
|
+
var inlined = (_table$getChild4 = table.getChild(FIELD_INLINED)) === null || _table$getChild4 === void 0 ? void 0 : _table$getChild4.get(row);
|
|
34
|
+
var locationLine = (_table$getChild$get2 = (_table$getChild5 = table.getChild(FIELD_LOCATION_LINE)) === null || _table$getChild5 === void 0 ? void 0 : _table$getChild5.get(row)) !== null && _table$getChild$get2 !== void 0 ? _table$getChild$get2 : 0n;
|
|
35
|
+
var functionFilename = (_arrowToString = arrowToString((_table$getChild6 = table.getChild(FIELD_FUNCTION_FILE_NAME)) === null || _table$getChild6 === void 0 ? void 0 : _table$getChild6.get(row))) !== null && _arrowToString !== void 0 ? _arrowToString : '';
|
|
36
|
+
var functionSystemName = (_arrowToString2 = arrowToString((_table$getChild7 = table.getChild(FIELD_FUNCTION_SYSTEM_NAME)) === null || _table$getChild7 === void 0 ? void 0 : _table$getChild7.get(row))) !== null && _arrowToString2 !== void 0 ? _arrowToString2 : '';
|
|
37
|
+
var functionStartLine = (_table$getChild$get3 = (_table$getChild8 = table.getChild(FIELD_FUNCTION_START_LINE)) === null || _table$getChild8 === void 0 ? void 0 : _table$getChild8.get(row)) !== null && _table$getChild$get3 !== void 0 ? _table$getChild$get3 : 0n;
|
|
38
|
+
var lineNumber = locationLine !== 0n ? locationLine : functionStartLine !== 0n ? functionStartLine : undefined;
|
|
39
|
+
var labelPrefix = 'labels.';
|
|
40
|
+
var labelColumnNames = table.schema.fields.filter(function (field) {
|
|
41
|
+
return field.name.startsWith(labelPrefix);
|
|
42
|
+
});
|
|
43
|
+
var timestamp = (_table$getChild9 = table.getChild(FIELD_TIMESTAMP)) === null || _table$getChild9 === void 0 ? void 0 : _table$getChild9.get(row);
|
|
44
|
+
var _useParcaContext = useParcaContext(),
|
|
45
|
+
queryServiceClient = _useParcaContext.queryServiceClient,
|
|
46
|
+
enableSourcesView = _useParcaContext.enableSourcesView;
|
|
47
|
+
var _useProfileViewContex = useProfileViewContext(),
|
|
48
|
+
profileSource = _useProfileViewContex.profileSource;
|
|
49
|
+
var _useQuery = useQuery(queryServiceClient, profileSource, QueryRequest_ReportType.SOURCE, {
|
|
50
|
+
skip: enableSourcesView === false || profileSource === undefined ||
|
|
51
|
+
// eslint-disable-next-line no-extra-boolean-cast
|
|
52
|
+
!Boolean(mappingBuildID) ||
|
|
53
|
+
// eslint-disable-next-line no-extra-boolean-cast
|
|
54
|
+
!Boolean(functionFilename),
|
|
55
|
+
sourceBuildID: mappingBuildID !== null ? mappingBuildID : undefined,
|
|
56
|
+
sourceFilename: functionFilename,
|
|
57
|
+
sourceOnly: true
|
|
58
|
+
}),
|
|
59
|
+
sourceLoading = _useQuery.isLoading,
|
|
60
|
+
sourceResponse = _useQuery.response;
|
|
61
|
+
var isSourceAvailable = !sourceLoading && (sourceResponse === null || sourceResponse === void 0 ? void 0 : sourceResponse.report) != null;
|
|
62
|
+
var getTextForFile = function getTextForFile() {
|
|
63
|
+
if (functionFilename === '') return '<unknown>';
|
|
64
|
+
return "".concat(functionFilename, " ").concat(lineNumber !== undefined ? " +".concat(lineNumber.toString()) : '');
|
|
65
|
+
};
|
|
66
|
+
var file = getTextForFile();
|
|
67
|
+
var labelPairs = labelColumnNames.map(function (field_0, i) {
|
|
68
|
+
var _arrowToString3, _table$getChild0;
|
|
69
|
+
return [labelColumnNames[i].name.slice(labelPrefix.length), (_arrowToString3 = arrowToString((_table$getChild0 = table.getChild(field_0.name)) === null || _table$getChild0 === void 0 ? void 0 : _table$getChild0.get(row))) !== null && _arrowToString3 !== void 0 ? _arrowToString3 : ''];
|
|
70
|
+
}).filter(function (value) {
|
|
71
|
+
return value[1] !== '';
|
|
72
|
+
});
|
|
73
|
+
var _useURLState = useURLState('dashboard_items', {
|
|
74
|
+
alwaysReturnArray: true
|
|
75
|
+
}),
|
|
76
|
+
_useURLState2 = _slicedToArray(_useURLState, 2),
|
|
77
|
+
dashboardItems = _useURLState2[0],
|
|
78
|
+
setDashboardItems = _useURLState2[1];
|
|
79
|
+
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
81
|
+
var _useURLState3 = useURLState('source_buildid'),
|
|
82
|
+
_useURLState4 = _slicedToArray(_useURLState3, 2),
|
|
83
|
+
unusedBuildId = _useURLState4[0],
|
|
84
|
+
setSourceBuildId = _useURLState4[1];
|
|
85
|
+
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
87
|
+
var _useURLState5 = useURLState('source_filename'),
|
|
88
|
+
_useURLState6 = _slicedToArray(_useURLState5, 2),
|
|
89
|
+
unusedFilename = _useURLState6[0],
|
|
90
|
+
setSourceFilename = _useURLState6[1];
|
|
91
|
+
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
93
|
+
var _useURLState7 = useURLState('source_line'),
|
|
94
|
+
_useURLState8 = _slicedToArray(_useURLState7, 2),
|
|
95
|
+
unusedLine = _useURLState8[0],
|
|
96
|
+
setSourceLine = _useURLState8[1];
|
|
97
|
+
var openFile = function openFile() {
|
|
98
|
+
setDashboardItems([dashboardItems[0], 'source']);
|
|
99
|
+
if (mappingBuildID != null) {
|
|
100
|
+
setSourceBuildId(mappingBuildID);
|
|
101
|
+
}
|
|
102
|
+
setSourceFilename(functionFilename);
|
|
103
|
+
if (lineNumber !== undefined) {
|
|
104
|
+
setSourceLine(lineNumber.toString());
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return {
|
|
108
|
+
labelPairs: labelPairs,
|
|
109
|
+
functionFilename: functionFilename,
|
|
110
|
+
functionSystemName: functionSystemName,
|
|
111
|
+
file: file,
|
|
112
|
+
openFile: openFile,
|
|
113
|
+
isSourceAvailable: isSourceAvailable,
|
|
114
|
+
locationAddress: locationAddress,
|
|
115
|
+
mappingBuildID: mappingBuildID,
|
|
116
|
+
mappingFile: mappingFile,
|
|
117
|
+
inlined: inlined,
|
|
118
|
+
timestamp: timestamp
|
|
119
|
+
};
|
|
120
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
2
|
// Copyright 2022 The Parca Authors
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,17 +11,96 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
+
|
|
14
15
|
import { useEffect, useRef } from 'react';
|
|
15
16
|
import cx from 'classnames';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
var SuggestionItem = function SuggestionItem(t0) {
|
|
19
|
+
var $ = _c(17);
|
|
20
|
+
var isHighlighted = t0.isHighlighted,
|
|
21
|
+
onHighlight = t0.onHighlight,
|
|
22
|
+
onApplySuggestion = t0.onApplySuggestion,
|
|
23
|
+
onResetHighlight = t0.onResetHighlight,
|
|
24
|
+
value = t0.value;
|
|
25
|
+
var ref = useRef(null);
|
|
26
|
+
var t1;
|
|
27
|
+
var t2;
|
|
28
|
+
if ($[0] !== isHighlighted) {
|
|
29
|
+
t1 = function t1() {
|
|
30
|
+
if (isHighlighted && ref.current != null) {
|
|
31
|
+
ref.current.scrollIntoView({
|
|
32
|
+
block: "nearest"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
t2 = [isHighlighted];
|
|
37
|
+
$[0] = isHighlighted;
|
|
38
|
+
$[1] = t1;
|
|
39
|
+
$[2] = t2;
|
|
40
|
+
} else {
|
|
41
|
+
t1 = $[1];
|
|
42
|
+
t2 = $[2];
|
|
43
|
+
}
|
|
44
|
+
useEffect(t1, t2);
|
|
45
|
+
var t3;
|
|
46
|
+
if ($[3] !== isHighlighted) {
|
|
47
|
+
t3 = cx("relative cursor-default select-none py-2 pl-3 pr-9", {
|
|
48
|
+
"bg-indigo-600 text-white": isHighlighted
|
|
49
|
+
});
|
|
50
|
+
$[3] = isHighlighted;
|
|
51
|
+
$[4] = t3;
|
|
52
|
+
} else {
|
|
53
|
+
t3 = $[4];
|
|
54
|
+
}
|
|
55
|
+
var t4;
|
|
56
|
+
if ($[5] !== onHighlight) {
|
|
57
|
+
t4 = function t4() {
|
|
58
|
+
return onHighlight();
|
|
59
|
+
};
|
|
60
|
+
$[5] = onHighlight;
|
|
61
|
+
$[6] = t4;
|
|
62
|
+
} else {
|
|
63
|
+
t4 = $[6];
|
|
64
|
+
}
|
|
65
|
+
var t5;
|
|
66
|
+
if ($[7] !== onApplySuggestion) {
|
|
67
|
+
t5 = function t5() {
|
|
68
|
+
return onApplySuggestion();
|
|
69
|
+
};
|
|
70
|
+
$[7] = onApplySuggestion;
|
|
71
|
+
$[8] = t5;
|
|
72
|
+
} else {
|
|
73
|
+
t5 = $[8];
|
|
74
|
+
}
|
|
75
|
+
var t6;
|
|
76
|
+
if ($[9] !== onResetHighlight) {
|
|
77
|
+
t6 = function t6() {
|
|
78
|
+
return onResetHighlight();
|
|
79
|
+
};
|
|
80
|
+
$[9] = onResetHighlight;
|
|
81
|
+
$[10] = t6;
|
|
82
|
+
} else {
|
|
83
|
+
t6 = $[10];
|
|
84
|
+
}
|
|
85
|
+
var t7;
|
|
86
|
+
if ($[11] !== t3 || $[12] !== t4 || $[13] !== t5 || $[14] !== t6 || $[15] !== value) {
|
|
87
|
+
t7 = /*#__PURE__*/_jsx("div", {
|
|
88
|
+
className: t3,
|
|
89
|
+
onMouseOver: t4,
|
|
90
|
+
onClick: t5,
|
|
91
|
+
onMouseOut: t6,
|
|
92
|
+
ref: ref,
|
|
93
|
+
children: value
|
|
94
|
+
});
|
|
95
|
+
$[11] = t3;
|
|
96
|
+
$[12] = t4;
|
|
97
|
+
$[13] = t5;
|
|
98
|
+
$[14] = t6;
|
|
99
|
+
$[15] = value;
|
|
100
|
+
$[16] = t7;
|
|
101
|
+
} else {
|
|
102
|
+
t7 = $[16];
|
|
103
|
+
}
|
|
104
|
+
return t7;
|
|
26
105
|
};
|
|
27
|
-
export default SuggestionItem;
|
|
106
|
+
export default SuggestionItem;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export declare class Suggestion {
|
|
2
3
|
type: string;
|
|
3
4
|
typeahead: string;
|
|
@@ -13,7 +14,7 @@ export declare class Suggestions {
|
|
|
13
14
|
interface Props {
|
|
14
15
|
suggestions: Suggestions;
|
|
15
16
|
applySuggestion: (suggestion: Suggestion) => void;
|
|
16
|
-
inputRef: HTMLTextAreaElement | null
|
|
17
|
+
inputRef: React.RefObject<HTMLTextAreaElement | null>;
|
|
17
18
|
runQuery: () => void;
|
|
18
19
|
focusedInput: boolean;
|
|
19
20
|
isLabelNamesLoading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionsList.d.ts","sourceRoot":"","sources":["../../src/MatchersInput/SuggestionsList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SuggestionsList.d.ts","sourceRoot":"","sources":["../../src/MatchersInput/SuggestionsList.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAUxE,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;gBAEF,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAK3D;AAED,qBAAa,WAAW;IACtB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;;CAO3B;AAED,UAAU,KAAK;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAClD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACtD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAaD,QAAA,MAAM,eAAe,GAAI,yKAWtB,KAAK,KAAG,GAAG,CAAC,OAyUd,CAAC;AAEF,eAAe,eAAe,CAAC"}
|