@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 _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
|
+
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); }
|
|
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,6 +27,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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.
|
|
30
|
+
|
|
14
31
|
import { useMemo, useRef, useState } from 'react';
|
|
15
32
|
import { Icon } from '@iconify/react';
|
|
16
33
|
import cx from 'classnames';
|
|
@@ -21,147 +38,641 @@ import { Button, useParcaContext } from '@parca/components';
|
|
|
21
38
|
import { TimelineGuide } from '../../TimelineGuide';
|
|
22
39
|
import { SamplesGraph } from './SamplesGraph';
|
|
23
40
|
import { createLabelSetComparator, labelSetToString } from './labelSetUtils';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
42
|
+
var STRIP_HEIGHT = 24;
|
|
43
|
+
var LABEL_ROW_HEIGHT = 16; // text-xs label row above each strip
|
|
44
|
+
var GAP = 4; // gap-1 between flex children
|
|
45
|
+
var MAX_VISIBLE_STRIPS = 20;
|
|
46
|
+
var LOADING_STRIP_COUNT = 8;
|
|
47
|
+
var generateMockStripData = function generateMockStripData(bounds) {
|
|
48
|
+
var stepMs = Math.max(Math.floor((bounds[1] - bounds[0]) / 240), 100);
|
|
49
|
+
var cpus = Array.from({
|
|
50
|
+
length: LOADING_STRIP_COUNT
|
|
51
|
+
}, function (_, i) {
|
|
52
|
+
return {
|
|
53
|
+
labels: [{
|
|
54
|
+
name: 'cpu',
|
|
55
|
+
value: String(i)
|
|
56
|
+
}]
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
var seed = 42;
|
|
60
|
+
var data = cpus.map(function () {
|
|
61
|
+
var points = [];
|
|
62
|
+
for (var ts = bounds[0]; ts < bounds[1]; ts += stepMs) {
|
|
63
|
+
seed = (seed * 16807 + 11) % 2147483647;
|
|
64
|
+
var value = seed % 80 + 10;
|
|
65
|
+
seed = (seed * 16807 + 11) % 2147483647;
|
|
66
|
+
var sampleCount = seed % 50 + 1;
|
|
67
|
+
points.push({
|
|
68
|
+
timestamp: ts,
|
|
69
|
+
value: value,
|
|
70
|
+
sampleCount: sampleCount
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return points;
|
|
74
|
+
});
|
|
75
|
+
return {
|
|
76
|
+
cpus: cpus,
|
|
77
|
+
data: data,
|
|
78
|
+
stepMs: stepMs
|
|
79
|
+
};
|
|
47
80
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
81
|
+
var getTimelineGuideHeight = function getTimelineGuideHeight(cpusCount, collapsedCount) {
|
|
82
|
+
var expandedCount = cpusCount - collapsedCount;
|
|
83
|
+
// Each expanded strip: label row + graph height
|
|
84
|
+
// Each collapsed strip: min-h-5 (20px)
|
|
85
|
+
// Gaps between strips (gap-1 = 4px)
|
|
86
|
+
var expandedTotal = expandedCount * (LABEL_ROW_HEIGHT + STRIP_HEIGHT);
|
|
87
|
+
var collapsedTotal = collapsedCount * 20; // min-h-5
|
|
88
|
+
var gaps = cpusCount * GAP + 20; // timeline header
|
|
89
|
+
return expandedTotal + collapsedTotal + gaps;
|
|
57
90
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
91
|
+
var stickyPx = 0;
|
|
92
|
+
var SamplesGraphContainer = function SamplesGraphContainer(t0) {
|
|
93
|
+
var $ = _c(36);
|
|
94
|
+
var isSelected = t0.isSelected,
|
|
95
|
+
isCollapsed = t0.isCollapsed,
|
|
96
|
+
labelStr = t0.label,
|
|
97
|
+
width = t0.width,
|
|
98
|
+
onToggleCollapse = t0.onToggleCollapse,
|
|
99
|
+
data = t0.data,
|
|
100
|
+
selectionBounds = t0.selectionBounds,
|
|
101
|
+
setSelectionBounds = t0.setSelectionBounds,
|
|
102
|
+
color = t0.color,
|
|
103
|
+
stepMs = t0.stepMs,
|
|
104
|
+
_onDragStart = t0.onDragStart,
|
|
105
|
+
dragState = t0.dragState,
|
|
106
|
+
stripIndex = t0.stripIndex,
|
|
107
|
+
isAnyDragActive = t0.isAnyDragActive,
|
|
108
|
+
timeBounds = t0.timeBounds,
|
|
109
|
+
loading = t0.loading;
|
|
110
|
+
var t1;
|
|
111
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
112
|
+
t1 = {
|
|
113
|
+
rootMargin: "".concat(stickyPx, "px 0px 0px 0px")
|
|
114
|
+
};
|
|
115
|
+
$[0] = t1;
|
|
116
|
+
} else {
|
|
117
|
+
t1 = $[0];
|
|
118
|
+
}
|
|
119
|
+
var _useIntersectionObser = useIntersectionObserver(t1),
|
|
120
|
+
isIntersecting = _useIntersectionObser.isIntersecting,
|
|
121
|
+
ref = _useIntersectionObser.ref;
|
|
122
|
+
var isSticky = isSelected && isIntersecting;
|
|
123
|
+
var t2 = !isSelected;
|
|
124
|
+
var t3;
|
|
125
|
+
if ($[1] !== isSelected || $[2] !== isSticky || $[3] !== t2) {
|
|
126
|
+
t3 = cx("min-h-5", {
|
|
127
|
+
relative: t2,
|
|
128
|
+
"sticky z-30 bg-white dark:bg-black bg-opacity-75": isSelected,
|
|
129
|
+
"!bg-opacity-100": isSticky
|
|
62
130
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
131
|
+
$[1] = isSelected;
|
|
132
|
+
$[2] = isSticky;
|
|
133
|
+
$[3] = t2;
|
|
134
|
+
$[4] = t3;
|
|
135
|
+
} else {
|
|
136
|
+
t3 = $[4];
|
|
137
|
+
}
|
|
138
|
+
var t4 = width !== null && width !== void 0 ? width : 1468;
|
|
139
|
+
var t5 = isSelected ? stickyPx : undefined;
|
|
140
|
+
var t6;
|
|
141
|
+
if ($[5] !== t4 || $[6] !== t5) {
|
|
142
|
+
t6 = {
|
|
143
|
+
width: t4,
|
|
144
|
+
top: t5
|
|
145
|
+
};
|
|
146
|
+
$[5] = t4;
|
|
147
|
+
$[6] = t5;
|
|
148
|
+
$[7] = t6;
|
|
149
|
+
} else {
|
|
150
|
+
t6 = $[7];
|
|
151
|
+
}
|
|
152
|
+
var t7 = loading === true ? undefined : onToggleCollapse;
|
|
153
|
+
var t8;
|
|
154
|
+
if ($[8] !== isCollapsed || $[9] !== labelStr || $[10] !== loading) {
|
|
155
|
+
t8 = loading === true ? /*#__PURE__*/_jsx("div", {
|
|
156
|
+
className: "h-3 w-24 rounded bg-gray-200 dark:bg-gray-700 mb-1"
|
|
157
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
158
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
159
|
+
icon: isCollapsed ? "bxs:right-arrow" : "bxs:down-arrow",
|
|
160
|
+
className: "shrink-0"
|
|
161
|
+
}), labelStr]
|
|
162
|
+
});
|
|
163
|
+
$[8] = isCollapsed;
|
|
164
|
+
$[9] = labelStr;
|
|
165
|
+
$[10] = loading;
|
|
166
|
+
$[11] = t8;
|
|
167
|
+
} else {
|
|
168
|
+
t8 = $[11];
|
|
169
|
+
}
|
|
170
|
+
var t9;
|
|
171
|
+
if ($[12] !== t7 || $[13] !== t8) {
|
|
172
|
+
t9 = /*#__PURE__*/_jsx("div", {
|
|
173
|
+
className: "text-xs flex gap-[2px] items-center px-1 cursor-pointer text-gray-600 dark:text-gray-400",
|
|
174
|
+
onClick: t7,
|
|
175
|
+
children: t8
|
|
176
|
+
});
|
|
177
|
+
$[12] = t7;
|
|
178
|
+
$[13] = t8;
|
|
179
|
+
$[14] = t9;
|
|
180
|
+
} else {
|
|
181
|
+
t9 = $[14];
|
|
182
|
+
}
|
|
183
|
+
var t10;
|
|
184
|
+
if ($[15] !== color || $[16] !== data || $[17] !== dragState || $[18] !== isAnyDragActive || $[19] !== isCollapsed || $[20] !== labelStr || $[21] !== _onDragStart || $[22] !== selectionBounds || $[23] !== setSelectionBounds || $[24] !== stepMs || $[25] !== stripIndex || $[26] !== timeBounds || $[27] !== width) {
|
|
185
|
+
t10 = !isCollapsed ? /*#__PURE__*/_jsx(SamplesGraph, {
|
|
186
|
+
data: data,
|
|
187
|
+
height: STRIP_HEIGHT,
|
|
188
|
+
width: width !== null && width !== void 0 ? width : 1468,
|
|
189
|
+
fill: color(labelStr),
|
|
190
|
+
selectionBounds: selectionBounds,
|
|
191
|
+
setSelectionBounds: setSelectionBounds,
|
|
192
|
+
stepMs: stepMs,
|
|
193
|
+
onDragStart: function onDragStart(startX) {
|
|
194
|
+
return _onDragStart(stripIndex, startX);
|
|
195
|
+
},
|
|
196
|
+
dragState: (dragState === null || dragState === void 0 ? void 0 : dragState.stripIndex) === stripIndex ? dragState : undefined,
|
|
197
|
+
isAnyDragActive: isAnyDragActive,
|
|
198
|
+
timeBounds: timeBounds
|
|
199
|
+
}) : null;
|
|
200
|
+
$[15] = color;
|
|
201
|
+
$[16] = data;
|
|
202
|
+
$[17] = dragState;
|
|
203
|
+
$[18] = isAnyDragActive;
|
|
204
|
+
$[19] = isCollapsed;
|
|
205
|
+
$[20] = labelStr;
|
|
206
|
+
$[21] = _onDragStart;
|
|
207
|
+
$[22] = selectionBounds;
|
|
208
|
+
$[23] = setSelectionBounds;
|
|
209
|
+
$[24] = stepMs;
|
|
210
|
+
$[25] = stripIndex;
|
|
211
|
+
$[26] = timeBounds;
|
|
212
|
+
$[27] = width;
|
|
213
|
+
$[28] = t10;
|
|
214
|
+
} else {
|
|
215
|
+
t10 = $[28];
|
|
216
|
+
}
|
|
217
|
+
var t11;
|
|
218
|
+
if ($[29] !== labelStr || $[30] !== ref || $[31] !== t10 || $[32] !== t3 || $[33] !== t6 || $[34] !== t9) {
|
|
219
|
+
t11 = /*#__PURE__*/_jsxs("div", {
|
|
220
|
+
className: t3,
|
|
221
|
+
style: t6,
|
|
222
|
+
ref: ref,
|
|
223
|
+
children: [t9, t10]
|
|
224
|
+
}, labelStr);
|
|
225
|
+
$[29] = labelStr;
|
|
226
|
+
$[30] = ref;
|
|
227
|
+
$[31] = t10;
|
|
228
|
+
$[32] = t3;
|
|
229
|
+
$[33] = t6;
|
|
230
|
+
$[34] = t9;
|
|
231
|
+
$[35] = t11;
|
|
232
|
+
} else {
|
|
233
|
+
t11 = $[35];
|
|
234
|
+
}
|
|
235
|
+
return t11;
|
|
71
236
|
};
|
|
72
|
-
export
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
237
|
+
export var SamplesStrip = function SamplesStrip(t0) {
|
|
238
|
+
var _mockData$cpus, _mockData$data, _mockData$stepMs;
|
|
239
|
+
var $ = _c(95);
|
|
240
|
+
var loading = t0.loading,
|
|
241
|
+
cpus = t0.cpus,
|
|
242
|
+
data = t0.data,
|
|
243
|
+
selectedTimeframe = t0.selectedTimeframe,
|
|
244
|
+
onSelectedTimeframe = t0.onSelectedTimeframe,
|
|
245
|
+
width = t0.width,
|
|
246
|
+
bounds = t0.bounds,
|
|
247
|
+
stepMs = t0.stepMs;
|
|
248
|
+
var _useParcaContext = useParcaContext(),
|
|
249
|
+
isDarkMode = _useParcaContext.isDarkMode;
|
|
250
|
+
var effectiveLoading = loading === true;
|
|
251
|
+
var t1;
|
|
252
|
+
if ($[0] !== bounds || $[1] !== effectiveLoading) {
|
|
253
|
+
t1 = effectiveLoading && bounds[0] !== bounds[1] ? generateMockStripData(bounds) : null;
|
|
254
|
+
$[0] = bounds;
|
|
255
|
+
$[1] = effectiveLoading;
|
|
256
|
+
$[2] = t1;
|
|
257
|
+
} else {
|
|
258
|
+
t1 = $[2];
|
|
259
|
+
}
|
|
260
|
+
var mockData = t1;
|
|
261
|
+
var effectiveCpus = (_mockData$cpus = mockData === null || mockData === void 0 ? void 0 : mockData.cpus) !== null && _mockData$cpus !== void 0 ? _mockData$cpus : cpus;
|
|
262
|
+
var effectiveData = (_mockData$data = mockData === null || mockData === void 0 ? void 0 : mockData.data) !== null && _mockData$data !== void 0 ? _mockData$data : data;
|
|
263
|
+
var effectiveStepMs = (_mockData$stepMs = mockData === null || mockData === void 0 ? void 0 : mockData.stepMs) !== null && _mockData$stepMs !== void 0 ? _mockData$stepMs : stepMs;
|
|
264
|
+
var t2;
|
|
265
|
+
if ($[3] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
266
|
+
t2 = new Set();
|
|
267
|
+
$[3] = t2;
|
|
268
|
+
} else {
|
|
269
|
+
t2 = $[3];
|
|
270
|
+
}
|
|
271
|
+
var _useState = useState(t2),
|
|
272
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
273
|
+
collapsedLabels = _useState2[0],
|
|
274
|
+
setCollapsedLabels = _useState2[1];
|
|
275
|
+
var _useState3 = useState(false),
|
|
276
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
277
|
+
showAll = _useState4[0],
|
|
278
|
+
setShowAll = _useState4[1];
|
|
279
|
+
var _useState5 = useState(undefined),
|
|
280
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
281
|
+
dragState = _useState6[0],
|
|
282
|
+
setDragState = _useState6[1];
|
|
283
|
+
var containerRef = useRef(null);
|
|
284
|
+
var isDragging = dragState !== undefined;
|
|
285
|
+
var t3;
|
|
286
|
+
if ($[4] !== effectiveCpus) {
|
|
287
|
+
t3 = createLabelSetComparator(effectiveCpus);
|
|
288
|
+
$[4] = effectiveCpus;
|
|
289
|
+
$[5] = t3;
|
|
290
|
+
} else {
|
|
291
|
+
t3 = $[5];
|
|
292
|
+
}
|
|
293
|
+
var _t = t3,
|
|
294
|
+
compare = _t.compare,
|
|
295
|
+
keyOrder = _t.keyOrder;
|
|
296
|
+
var t4;
|
|
297
|
+
if ($[6] !== compare || $[7] !== effectiveCpus || $[8] !== effectiveData || $[9] !== keyOrder) {
|
|
298
|
+
var _t2;
|
|
299
|
+
if ($[11] !== effectiveData || $[12] !== keyOrder) {
|
|
300
|
+
_t2 = function _t2(cpu, i) {
|
|
301
|
+
return {
|
|
302
|
+
cpu: cpu,
|
|
303
|
+
data: effectiveData[i],
|
|
304
|
+
label: labelSetToString(cpu, keyOrder)
|
|
109
305
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
306
|
+
};
|
|
307
|
+
$[11] = effectiveData;
|
|
308
|
+
$[12] = keyOrder;
|
|
309
|
+
$[13] = _t2;
|
|
310
|
+
} else {
|
|
311
|
+
_t2 = $[13];
|
|
312
|
+
}
|
|
313
|
+
var items = effectiveCpus.map(_t2);
|
|
314
|
+
var _t3;
|
|
315
|
+
if ($[14] !== compare) {
|
|
316
|
+
_t3 = function _t3(a, b) {
|
|
317
|
+
return compare(a.cpu, b.cpu);
|
|
318
|
+
};
|
|
319
|
+
$[14] = compare;
|
|
320
|
+
$[15] = _t3;
|
|
321
|
+
} else {
|
|
322
|
+
_t3 = $[15];
|
|
323
|
+
}
|
|
324
|
+
t4 = items.sort(_t3);
|
|
325
|
+
$[6] = compare;
|
|
326
|
+
$[7] = effectiveCpus;
|
|
327
|
+
$[8] = effectiveData;
|
|
328
|
+
$[9] = keyOrder;
|
|
329
|
+
$[10] = t4;
|
|
330
|
+
} else {
|
|
331
|
+
t4 = $[10];
|
|
332
|
+
}
|
|
333
|
+
var sortedItems = t4;
|
|
334
|
+
var hasMore = sortedItems.length > MAX_VISIBLE_STRIPS;
|
|
335
|
+
var t5;
|
|
336
|
+
if ($[16] !== hasMore || $[17] !== showAll || $[18] !== sortedItems) {
|
|
337
|
+
t5 = showAll || !hasMore ? sortedItems : sortedItems.slice(0, MAX_VISIBLE_STRIPS);
|
|
338
|
+
$[16] = hasMore;
|
|
339
|
+
$[17] = showAll;
|
|
340
|
+
$[18] = sortedItems;
|
|
341
|
+
$[19] = t5;
|
|
342
|
+
} else {
|
|
343
|
+
t5 = $[19];
|
|
344
|
+
}
|
|
345
|
+
var visibleItems = t5;
|
|
346
|
+
var t6;
|
|
347
|
+
bb0: {
|
|
348
|
+
if (effectiveLoading) {
|
|
349
|
+
var _t4;
|
|
350
|
+
if ($[20] !== isDarkMode) {
|
|
351
|
+
_t4 = function _t4(_label) {
|
|
352
|
+
return isDarkMode ? "#374151" : "#d1d5db";
|
|
353
|
+
};
|
|
354
|
+
$[20] = isDarkMode;
|
|
355
|
+
$[21] = _t4;
|
|
356
|
+
} else {
|
|
357
|
+
_t4 = $[21];
|
|
358
|
+
}
|
|
359
|
+
t6 = _t4;
|
|
360
|
+
break bb0;
|
|
361
|
+
}
|
|
362
|
+
var palette = d3.schemeObservable10;
|
|
363
|
+
var hashStr = _temp;
|
|
364
|
+
var _t5;
|
|
365
|
+
if ($[22] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
366
|
+
_t5 = function _t5(label) {
|
|
367
|
+
return palette[hashStr(label) % palette.length];
|
|
368
|
+
};
|
|
369
|
+
$[22] = _t5;
|
|
370
|
+
} else {
|
|
371
|
+
_t5 = $[22];
|
|
372
|
+
}
|
|
373
|
+
t6 = _t5;
|
|
374
|
+
}
|
|
375
|
+
var color = t6;
|
|
376
|
+
var t7;
|
|
377
|
+
if ($[23] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
378
|
+
t7 = function t7(stripIndex, startX) {
|
|
379
|
+
setDragState({
|
|
380
|
+
stripIndex: stripIndex,
|
|
381
|
+
startX: startX,
|
|
382
|
+
currentX: startX
|
|
383
|
+
});
|
|
114
384
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
385
|
+
$[23] = t7;
|
|
386
|
+
} else {
|
|
387
|
+
t7 = $[23];
|
|
388
|
+
}
|
|
389
|
+
var handleDragStart = t7;
|
|
390
|
+
var t8;
|
|
391
|
+
if ($[24] !== dragState || $[25] !== width) {
|
|
392
|
+
t8 = function t8(e) {
|
|
393
|
+
if (dragState === undefined || containerRef.current === null) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
var rect = containerRef.current.getBoundingClientRect();
|
|
397
|
+
var x = e.clientX - rect.left;
|
|
398
|
+
var clampedX = Math.max(0, Math.min(x, width !== null && width !== void 0 ? width : rect.width));
|
|
399
|
+
setDragState(_objectSpread(_objectSpread({}, dragState), {}, {
|
|
400
|
+
currentX: clampedX
|
|
401
|
+
}));
|
|
123
402
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
403
|
+
$[24] = dragState;
|
|
404
|
+
$[25] = width;
|
|
405
|
+
$[26] = t8;
|
|
406
|
+
} else {
|
|
407
|
+
t8 = $[26];
|
|
408
|
+
}
|
|
409
|
+
var handleMouseMove = t8;
|
|
410
|
+
var t9;
|
|
411
|
+
if ($[27] !== bounds || $[28] !== dragState || $[29] !== onSelectedTimeframe || $[30] !== visibleItems || $[31] !== width) {
|
|
412
|
+
t9 = function t9(e_0) {
|
|
413
|
+
if (dragState === undefined || containerRef.current === null) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
var rect_0 = containerRef.current.getBoundingClientRect();
|
|
417
|
+
var x_0 = e_0.clientX - rect_0.left;
|
|
418
|
+
var clampedX_0 = Math.max(0, Math.min(x_0, width !== null && width !== void 0 ? width : rect_0.width));
|
|
419
|
+
var stripIndex_0 = dragState.stripIndex,
|
|
420
|
+
startX_0 = dragState.startX;
|
|
421
|
+
if (startX_0 !== clampedX_0) {
|
|
422
|
+
var start = Math.min(startX_0, clampedX_0);
|
|
423
|
+
var end = Math.max(startX_0, clampedX_0);
|
|
424
|
+
var innerWidth = width !== null && width !== void 0 ? width : rect_0.width;
|
|
425
|
+
var startTs = bounds[0] + start / innerWidth * (bounds[1] - bounds[0]);
|
|
426
|
+
var endTs = bounds[0] + end / innerWidth * (bounds[1] - bounds[0]);
|
|
427
|
+
onSelectedTimeframe(visibleItems[stripIndex_0].cpu, [startTs, endTs]);
|
|
428
|
+
}
|
|
429
|
+
setDragState(undefined);
|
|
141
430
|
};
|
|
142
|
-
|
|
143
|
-
|
|
431
|
+
$[27] = bounds;
|
|
432
|
+
$[28] = dragState;
|
|
433
|
+
$[29] = onSelectedTimeframe;
|
|
434
|
+
$[30] = visibleItems;
|
|
435
|
+
$[31] = width;
|
|
436
|
+
$[32] = t9;
|
|
437
|
+
} else {
|
|
438
|
+
t9 = $[32];
|
|
439
|
+
}
|
|
440
|
+
var handleMouseUp = t9;
|
|
441
|
+
var t10;
|
|
442
|
+
if ($[33] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
443
|
+
t10 = function t10() {
|
|
444
|
+
setDragState(undefined);
|
|
144
445
|
};
|
|
145
|
-
|
|
146
|
-
|
|
446
|
+
$[33] = t10;
|
|
447
|
+
} else {
|
|
448
|
+
t10 = $[33];
|
|
449
|
+
}
|
|
450
|
+
var handleMouseLeave = t10;
|
|
451
|
+
if (!effectiveLoading && effectiveData.length === 0) {
|
|
452
|
+
var _t6;
|
|
453
|
+
if ($[34] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
454
|
+
_t6 = /*#__PURE__*/_jsx("span", {
|
|
455
|
+
className: "flex justify-center my-10",
|
|
456
|
+
children: "There is no data matching your filter criteria, please try changing the filter."
|
|
457
|
+
});
|
|
458
|
+
$[34] = _t6;
|
|
459
|
+
} else {
|
|
460
|
+
_t6 = $[34];
|
|
147
461
|
}
|
|
148
|
-
return
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
462
|
+
return _t6;
|
|
463
|
+
}
|
|
464
|
+
var t11;
|
|
465
|
+
if ($[35] !== effectiveLoading || $[36] !== isDragging) {
|
|
466
|
+
t11 = cx("flex flex-col gap-1 relative my-0", {
|
|
467
|
+
"cursor-ew-resize": isDragging,
|
|
468
|
+
"animate-pulse pointer-events-none": effectiveLoading
|
|
469
|
+
});
|
|
470
|
+
$[35] = effectiveLoading;
|
|
471
|
+
$[36] = isDragging;
|
|
472
|
+
$[37] = t11;
|
|
473
|
+
} else {
|
|
474
|
+
t11 = $[37];
|
|
475
|
+
}
|
|
476
|
+
var t12 = width !== null && width !== void 0 ? width : "100%";
|
|
477
|
+
var t13;
|
|
478
|
+
if ($[38] !== t12) {
|
|
479
|
+
t13 = {
|
|
480
|
+
width: t12
|
|
481
|
+
};
|
|
482
|
+
$[38] = t12;
|
|
483
|
+
$[39] = t13;
|
|
484
|
+
} else {
|
|
485
|
+
t13 = $[39];
|
|
486
|
+
}
|
|
487
|
+
var t14 = effectiveLoading ? undefined : handleMouseMove;
|
|
488
|
+
var t15 = effectiveLoading ? undefined : handleMouseUp;
|
|
489
|
+
var t16 = effectiveLoading ? undefined : handleMouseLeave;
|
|
490
|
+
var t17;
|
|
491
|
+
if ($[40] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
492
|
+
t17 = BigInt(0);
|
|
493
|
+
$[40] = t17;
|
|
494
|
+
} else {
|
|
495
|
+
t17 = $[40];
|
|
496
|
+
}
|
|
497
|
+
var t18 = bounds[1] - bounds[0];
|
|
498
|
+
var t19;
|
|
499
|
+
if ($[41] !== t18) {
|
|
500
|
+
t19 = BigInt(t18);
|
|
501
|
+
$[41] = t18;
|
|
502
|
+
$[42] = t19;
|
|
503
|
+
} else {
|
|
504
|
+
t19 = $[42];
|
|
505
|
+
}
|
|
506
|
+
var t20;
|
|
507
|
+
if ($[43] !== t19) {
|
|
508
|
+
t20 = [t17, t19];
|
|
509
|
+
$[43] = t19;
|
|
510
|
+
$[44] = t20;
|
|
511
|
+
} else {
|
|
512
|
+
t20 = $[44];
|
|
513
|
+
}
|
|
514
|
+
var t21 = width !== null && width !== void 0 ? width : 1468;
|
|
515
|
+
var t22 = visibleItems.length;
|
|
516
|
+
var t23;
|
|
517
|
+
if ($[45] !== collapsedLabels) {
|
|
518
|
+
t23 = _toConsumableArray(collapsedLabels);
|
|
519
|
+
$[45] = collapsedLabels;
|
|
520
|
+
$[46] = t23;
|
|
521
|
+
} else {
|
|
522
|
+
t23 = $[46];
|
|
523
|
+
}
|
|
524
|
+
var t24;
|
|
525
|
+
if ($[47] !== t23 || $[48] !== visibleItems) {
|
|
526
|
+
t24 = t23.filter(function (l) {
|
|
527
|
+
return visibleItems.some(function (item) {
|
|
528
|
+
return item.label === l;
|
|
529
|
+
});
|
|
530
|
+
});
|
|
531
|
+
$[47] = t23;
|
|
532
|
+
$[48] = visibleItems;
|
|
533
|
+
$[49] = t24;
|
|
534
|
+
} else {
|
|
535
|
+
t24 = $[49];
|
|
536
|
+
}
|
|
537
|
+
var t25;
|
|
538
|
+
if ($[50] !== t24.length || $[51] !== visibleItems.length) {
|
|
539
|
+
t25 = getTimelineGuideHeight(t22, t24.length);
|
|
540
|
+
$[50] = t24.length;
|
|
541
|
+
$[51] = visibleItems.length;
|
|
542
|
+
$[52] = t25;
|
|
543
|
+
} else {
|
|
544
|
+
t25 = $[52];
|
|
545
|
+
}
|
|
546
|
+
var t26;
|
|
547
|
+
if ($[53] !== t20 || $[54] !== t21 || $[55] !== t25) {
|
|
548
|
+
t26 = /*#__PURE__*/_jsx(TimelineGuide, {
|
|
549
|
+
bounds: t20,
|
|
550
|
+
width: t21,
|
|
551
|
+
height: t25,
|
|
552
|
+
margin: 1,
|
|
553
|
+
elevateGuideLines: true
|
|
554
|
+
});
|
|
555
|
+
$[53] = t20;
|
|
556
|
+
$[54] = t21;
|
|
557
|
+
$[55] = t25;
|
|
558
|
+
$[56] = t26;
|
|
559
|
+
} else {
|
|
560
|
+
t26 = $[56];
|
|
561
|
+
}
|
|
562
|
+
var t27;
|
|
563
|
+
if ($[57] !== bounds || $[58] !== collapsedLabels || $[59] !== color || $[60] !== dragState || $[61] !== effectiveLoading || $[62] !== effectiveStepMs || $[63] !== isDragging || $[64] !== onSelectedTimeframe || $[65] !== (selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.bounds) || $[66] !== (selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.labels) || $[67] !== visibleItems || $[68] !== width) {
|
|
564
|
+
var _t7;
|
|
565
|
+
if ($[70] !== bounds || $[71] !== collapsedLabels || $[72] !== color || $[73] !== dragState || $[74] !== effectiveLoading || $[75] !== effectiveStepMs || $[76] !== isDragging || $[77] !== onSelectedTimeframe || $[78] !== (selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.bounds) || $[79] !== (selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.labels) || $[80] !== width) {
|
|
566
|
+
_t7 = function _t7(item_0, i_1) {
|
|
567
|
+
var isCollapsed = collapsedLabels.has(item_0.label);
|
|
568
|
+
var isSelected = isEqual(item_0.cpu, selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.labels);
|
|
569
|
+
return /*#__PURE__*/_jsx(SamplesGraphContainer, {
|
|
570
|
+
isSelected: isSelected,
|
|
571
|
+
isCollapsed: isCollapsed,
|
|
572
|
+
label: item_0.label,
|
|
573
|
+
width: width,
|
|
574
|
+
data: item_0.data,
|
|
575
|
+
onToggleCollapse: function onToggleCollapse() {
|
|
576
|
+
var newCollapsedLabels = new Set(collapsedLabels);
|
|
577
|
+
if (collapsedLabels.has(item_0.label)) {
|
|
578
|
+
newCollapsedLabels["delete"](item_0.label);
|
|
579
|
+
} else {
|
|
580
|
+
newCollapsedLabels.add(item_0.label);
|
|
581
|
+
}
|
|
582
|
+
setCollapsedLabels(newCollapsedLabels);
|
|
583
|
+
},
|
|
584
|
+
selectionBounds: isSelected ? selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.bounds : undefined,
|
|
585
|
+
setSelectionBounds: function setSelectionBounds(newBounds) {
|
|
586
|
+
onSelectedTimeframe(item_0.cpu, newBounds);
|
|
587
|
+
},
|
|
588
|
+
color: color,
|
|
589
|
+
stepMs: effectiveStepMs,
|
|
590
|
+
onDragStart: handleDragStart,
|
|
591
|
+
dragState: dragState,
|
|
592
|
+
stripIndex: i_1,
|
|
593
|
+
isAnyDragActive: isDragging,
|
|
594
|
+
timeBounds: bounds,
|
|
595
|
+
loading: effectiveLoading
|
|
596
|
+
}, item_0.label);
|
|
597
|
+
};
|
|
598
|
+
$[70] = bounds;
|
|
599
|
+
$[71] = collapsedLabels;
|
|
600
|
+
$[72] = color;
|
|
601
|
+
$[73] = dragState;
|
|
602
|
+
$[74] = effectiveLoading;
|
|
603
|
+
$[75] = effectiveStepMs;
|
|
604
|
+
$[76] = isDragging;
|
|
605
|
+
$[77] = onSelectedTimeframe;
|
|
606
|
+
$[78] = selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.bounds;
|
|
607
|
+
$[79] = selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.labels;
|
|
608
|
+
$[80] = width;
|
|
609
|
+
$[81] = _t7;
|
|
610
|
+
} else {
|
|
611
|
+
_t7 = $[81];
|
|
612
|
+
}
|
|
613
|
+
t27 = visibleItems.map(_t7);
|
|
614
|
+
$[57] = bounds;
|
|
615
|
+
$[58] = collapsedLabels;
|
|
616
|
+
$[59] = color;
|
|
617
|
+
$[60] = dragState;
|
|
618
|
+
$[61] = effectiveLoading;
|
|
619
|
+
$[62] = effectiveStepMs;
|
|
620
|
+
$[63] = isDragging;
|
|
621
|
+
$[64] = onSelectedTimeframe;
|
|
622
|
+
$[65] = selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.bounds;
|
|
623
|
+
$[66] = selectedTimeframe === null || selectedTimeframe === void 0 ? void 0 : selectedTimeframe.labels;
|
|
624
|
+
$[67] = visibleItems;
|
|
625
|
+
$[68] = width;
|
|
626
|
+
$[69] = t27;
|
|
627
|
+
} else {
|
|
628
|
+
t27 = $[69];
|
|
629
|
+
}
|
|
630
|
+
var t28;
|
|
631
|
+
if ($[82] !== hasMore || $[83] !== showAll || $[84] !== sortedItems.length) {
|
|
632
|
+
t28 = hasMore && !showAll && /*#__PURE__*/_jsxs(Button, {
|
|
633
|
+
variant: "secondary",
|
|
634
|
+
onClick: function onClick() {
|
|
635
|
+
return setShowAll(true);
|
|
636
|
+
},
|
|
637
|
+
className: "w-fit mx-auto mt-2",
|
|
638
|
+
children: ["Show all ", sortedItems.length, " rows"]
|
|
639
|
+
});
|
|
640
|
+
$[82] = hasMore;
|
|
641
|
+
$[83] = showAll;
|
|
642
|
+
$[84] = sortedItems.length;
|
|
643
|
+
$[85] = t28;
|
|
644
|
+
} else {
|
|
645
|
+
t28 = $[85];
|
|
646
|
+
}
|
|
647
|
+
var t29;
|
|
648
|
+
if ($[86] !== t11 || $[87] !== t13 || $[88] !== t14 || $[89] !== t15 || $[90] !== t16 || $[91] !== t26 || $[92] !== t27 || $[93] !== t28) {
|
|
649
|
+
t29 = /*#__PURE__*/_jsxs("div", {
|
|
650
|
+
ref: containerRef,
|
|
651
|
+
className: t11,
|
|
652
|
+
style: t13,
|
|
653
|
+
onMouseMove: t14,
|
|
654
|
+
onMouseUp: t15,
|
|
655
|
+
onMouseLeave: t16,
|
|
656
|
+
children: [t26, t27, t28]
|
|
657
|
+
});
|
|
658
|
+
$[86] = t11;
|
|
659
|
+
$[87] = t13;
|
|
660
|
+
$[88] = t14;
|
|
661
|
+
$[89] = t15;
|
|
662
|
+
$[90] = t16;
|
|
663
|
+
$[91] = t26;
|
|
664
|
+
$[92] = t27;
|
|
665
|
+
$[93] = t28;
|
|
666
|
+
$[94] = t29;
|
|
667
|
+
} else {
|
|
668
|
+
t29 = $[94];
|
|
669
|
+
}
|
|
670
|
+
return t29;
|
|
167
671
|
};
|
|
672
|
+
function _temp(s) {
|
|
673
|
+
var h = 0;
|
|
674
|
+
for (var i_0 = 0; i_0 < s.length; i_0++) {
|
|
675
|
+
h = Math.imul(31, h) + s.charCodeAt(i_0) | 0;
|
|
676
|
+
}
|
|
677
|
+
return Math.abs(h);
|
|
678
|
+
}
|