@parca/profile 0.16.425 → 0.16.427
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 +8 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.js +1 -1
- package/dist/ProfileIcicleGraph/index.d.ts +1 -1
- package/dist/ProfileIcicleGraph/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/index.js +4 -59
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +11 -6
- package/dist/ProfileView/VisualizationPanel.d.ts.map +1 -1
- package/dist/ProfileView/VisualizationPanel.js +2 -3
- package/dist/ProfileView/index.d.ts.map +1 -1
- package/dist/ProfileView/index.js +21 -14
- package/dist/Table/ColumnsVisibility.js +1 -1
- package/dist/Table/index.d.ts +6 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +45 -21
- package/dist/ViewMatchers/index.d.ts +14 -0
- package/dist/ViewMatchers/index.d.ts.map +1 -0
- package/dist/ViewMatchers/index.js +103 -0
- package/dist/components/ActionButtons/GroupByDropdown.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph → components}/ActionButtons/GroupByDropdown.js +1 -1
- package/dist/components/FilterByFunctionButton.d.ts.map +1 -0
- package/dist/components/ShareButton/ResultBox.d.ts.map +1 -0
- package/dist/components/ShareButton/index.d.ts +14 -0
- package/dist/components/ShareButton/index.d.ts.map +1 -0
- package/dist/components/{ProfileShareButton → ShareButton}/index.js +28 -5
- package/dist/components/ViewSelector/Dropdown.d.ts +30 -0
- package/dist/components/ViewSelector/Dropdown.d.ts.map +1 -0
- package/dist/components/ViewSelector/Dropdown.js +41 -0
- package/dist/components/ViewSelector/index.d.ts +3 -0
- package/dist/components/ViewSelector/index.d.ts.map +1 -0
- package/dist/{ProfileView/ViewSelector.js → components/ViewSelector/index.js} +25 -12
- package/dist/components/VisualisationToolbar/MultiLevelDropdown.d.ts +9 -0
- package/dist/components/VisualisationToolbar/MultiLevelDropdown.d.ts.map +1 -0
- package/dist/components/VisualisationToolbar/MultiLevelDropdown.js +123 -0
- package/dist/components/VisualisationToolbar/TableColumnsDropdown.d.ts +9 -0
- package/dist/components/VisualisationToolbar/TableColumnsDropdown.d.ts.map +1 -0
- package/dist/components/VisualisationToolbar/TableColumnsDropdown.js +189 -0
- package/dist/components/VisualisationToolbar/index.d.ts +25 -0
- package/dist/components/VisualisationToolbar/index.d.ts.map +1 -0
- package/dist/components/VisualisationToolbar/index.js +55 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx +1 -1
- package/src/ProfileIcicleGraph/index.tsx +3 -206
- package/src/ProfileSelector/index.tsx +59 -33
- package/src/ProfileView/VisualizationPanel.tsx +1 -6
- package/src/ProfileView/index.tsx +46 -56
- package/src/Table/ColumnsVisibility.tsx +1 -1
- package/src/Table/index.tsx +64 -42
- package/src/ViewMatchers/index.tsx +190 -0
- package/src/{ProfileIcicleGraph → components}/ActionButtons/GroupByDropdown.tsx +1 -1
- package/src/components/{ProfileShareButton → ShareButton}/index.tsx +88 -24
- package/src/components/ViewSelector/Dropdown.tsx +181 -0
- package/src/{ProfileView/ViewSelector.tsx → components/ViewSelector/index.tsx} +32 -39
- package/src/components/VisualisationToolbar/MultiLevelDropdown.tsx +258 -0
- package/src/components/VisualisationToolbar/TableColumnsDropdown.tsx +222 -0
- package/src/components/VisualisationToolbar/index.tsx +171 -0
- package/src/index.tsx +3 -1
- package/dist/ProfileIcicleGraph/ActionButtons/GroupByDropdown.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/ActionButtons/SortBySelect.d.ts +0 -7
- package/dist/ProfileIcicleGraph/ActionButtons/SortBySelect.d.ts.map +0 -1
- package/dist/ProfileIcicleGraph/ActionButtons/SortBySelect.js +0 -44
- package/dist/ProfileView/FilterByFunctionButton.d.ts.map +0 -1
- package/dist/ProfileView/ViewSelector.d.ts +0 -13
- package/dist/ProfileView/ViewSelector.d.ts.map +0 -1
- package/dist/components/ProfileShareButton/ResultBox.d.ts.map +0 -1
- package/dist/components/ProfileShareButton/index.d.ts +0 -9
- package/dist/components/ProfileShareButton/index.d.ts.map +0 -1
- package/src/ProfileIcicleGraph/ActionButtons/SortBySelect.tsx +0 -81
- /package/dist/{ProfileIcicleGraph → components}/ActionButtons/GroupByDropdown.d.ts +0 -0
- /package/dist/{ProfileView → components}/FilterByFunctionButton.d.ts +0 -0
- /package/dist/{ProfileView → components}/FilterByFunctionButton.js +0 -0
- /package/dist/components/{ProfileShareButton → ShareButton}/ResultBox.d.ts +0 -0
- /package/dist/components/{ProfileShareButton → ShareButton}/ResultBox.js +0 -0
- /package/src/{ProfileView → components}/FilterByFunctionButton.tsx +0 -0
- /package/src/components/{ProfileShareButton → ShareButton}/ResultBox.tsx +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// Copyright 2022 The Parca Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
|
|
14
|
+
import {useCallback} from 'react';
|
|
15
|
+
|
|
16
|
+
import {Icon} from '@iconify/react';
|
|
17
|
+
import cx from 'classnames';
|
|
18
|
+
|
|
19
|
+
import {QueryRequest, QueryServiceClient} from '@parca/client';
|
|
20
|
+
import {Button, UserPreferencesModal, useParcaContext, useURLState} from '@parca/components';
|
|
21
|
+
import {ProfileType} from '@parca/parser';
|
|
22
|
+
|
|
23
|
+
import {FIELD_FUNCTION_NAME} from '../../ProfileIcicleGraph/IcicleGraphArrow';
|
|
24
|
+
import {ProfileSource} from '../../ProfileSource';
|
|
25
|
+
import GroupByDropdown from '../ActionButtons/GroupByDropdown';
|
|
26
|
+
import FilterByFunctionButton from '../FilterByFunctionButton';
|
|
27
|
+
import ShareButton from '../ShareButton';
|
|
28
|
+
import ViewSelector from '../ViewSelector';
|
|
29
|
+
import MultiLevelDropdown from './MultiLevelDropdown';
|
|
30
|
+
import TableColumnsDropdown from './TableColumnsDropdown';
|
|
31
|
+
|
|
32
|
+
interface Props {
|
|
33
|
+
groupBy: string | string[];
|
|
34
|
+
toggleGroupBy: (key: string) => void;
|
|
35
|
+
hasProfileSource: boolean;
|
|
36
|
+
isMultiPanelView: boolean;
|
|
37
|
+
dashboardItems: any;
|
|
38
|
+
profileSource?: ProfileSource;
|
|
39
|
+
queryClient?: QueryServiceClient;
|
|
40
|
+
queryRequest?: QueryRequest;
|
|
41
|
+
onDownloadPProf: () => void;
|
|
42
|
+
pprofdownloading: boolean | undefined;
|
|
43
|
+
curPath: string[];
|
|
44
|
+
setNewCurPath: (path: string[]) => void;
|
|
45
|
+
profileType?: ProfileType;
|
|
46
|
+
total: bigint;
|
|
47
|
+
filtered: bigint;
|
|
48
|
+
setSearchString?: (searchString: string) => void;
|
|
49
|
+
currentSearchString?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const VisualisationToolbar = ({
|
|
53
|
+
hasProfileSource,
|
|
54
|
+
profileSource,
|
|
55
|
+
queryClient,
|
|
56
|
+
onDownloadPProf,
|
|
57
|
+
pprofdownloading,
|
|
58
|
+
curPath,
|
|
59
|
+
setNewCurPath,
|
|
60
|
+
profileType,
|
|
61
|
+
total,
|
|
62
|
+
filtered,
|
|
63
|
+
setSearchString,
|
|
64
|
+
currentSearchString,
|
|
65
|
+
}: Props): JSX.Element => {
|
|
66
|
+
const [dashboardItems] = useURLState<string[]>('dashboard_items', {
|
|
67
|
+
alwaysReturnArray: true,
|
|
68
|
+
});
|
|
69
|
+
const {profileViewExternalMainActions, profileViewExternalSubActions, preferencesModal} =
|
|
70
|
+
useParcaContext();
|
|
71
|
+
|
|
72
|
+
console.log('🚀 ~ preferencesModal:', preferencesModal);
|
|
73
|
+
|
|
74
|
+
const [groupBy, setStoreGroupBy] = useURLState<string[]>('group_by', {
|
|
75
|
+
defaultValue: [FIELD_FUNCTION_NAME],
|
|
76
|
+
alwaysReturnArray: true,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const setGroupBy = useCallback(
|
|
80
|
+
(keys: string[]): void => {
|
|
81
|
+
setStoreGroupBy(keys);
|
|
82
|
+
},
|
|
83
|
+
[setStoreGroupBy]
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const toggleGroupBy = useCallback(
|
|
87
|
+
(key: string): void => {
|
|
88
|
+
groupBy.includes(key)
|
|
89
|
+
? setGroupBy(groupBy.filter(v => v !== key)) // remove
|
|
90
|
+
: setGroupBy([...groupBy, key]); // add
|
|
91
|
+
},
|
|
92
|
+
[groupBy, setGroupBy]
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const clearSelection = useCallback((): void => {
|
|
96
|
+
setSearchString?.('');
|
|
97
|
+
}, [setSearchString]);
|
|
98
|
+
|
|
99
|
+
const isTableViz = dashboardItems?.includes('table');
|
|
100
|
+
const isGraphViz = dashboardItems?.includes('icicle');
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<div
|
|
104
|
+
className={cx(
|
|
105
|
+
'mb-4 flex w-full',
|
|
106
|
+
hasProfileSource || profileViewExternalMainActions != null
|
|
107
|
+
? 'justify-between'
|
|
108
|
+
: 'justify-end',
|
|
109
|
+
{
|
|
110
|
+
'items-end': !hasProfileSource && profileViewExternalMainActions != null,
|
|
111
|
+
'items-center': hasProfileSource,
|
|
112
|
+
}
|
|
113
|
+
)}
|
|
114
|
+
>
|
|
115
|
+
<div className="flex w-full justify-between items-end">
|
|
116
|
+
<div className="flex gap-3 items-end">
|
|
117
|
+
{isGraphViz && (
|
|
118
|
+
<>
|
|
119
|
+
<GroupByDropdown groupBy={groupBy} toggleGroupBy={toggleGroupBy} />
|
|
120
|
+
<MultiLevelDropdown profileType={profileType} onSelect={() => {}} />
|
|
121
|
+
<Button
|
|
122
|
+
variant="neutral"
|
|
123
|
+
className="gap-2 w-max"
|
|
124
|
+
onClick={() => setNewCurPath([])}
|
|
125
|
+
disabled={curPath.length === 0}
|
|
126
|
+
>
|
|
127
|
+
Reset graph
|
|
128
|
+
<Icon icon="system-uicons:reset" width={20} />
|
|
129
|
+
</Button>
|
|
130
|
+
</>
|
|
131
|
+
)}
|
|
132
|
+
|
|
133
|
+
{isTableViz && (
|
|
134
|
+
<>
|
|
135
|
+
<TableColumnsDropdown profileType={profileType} total={total} filtered={filtered} />
|
|
136
|
+
{dashboardItems.length > 1 && (
|
|
137
|
+
<Button
|
|
138
|
+
color="neutral"
|
|
139
|
+
onClick={clearSelection}
|
|
140
|
+
className="w-auto"
|
|
141
|
+
variant="neutral"
|
|
142
|
+
disabled={currentSearchString === undefined || currentSearchString.length === 0}
|
|
143
|
+
>
|
|
144
|
+
Clear selection
|
|
145
|
+
</Button>
|
|
146
|
+
)}
|
|
147
|
+
</>
|
|
148
|
+
)}
|
|
149
|
+
|
|
150
|
+
<FilterByFunctionButton />
|
|
151
|
+
|
|
152
|
+
{profileViewExternalSubActions != null ? profileViewExternalSubActions : null}
|
|
153
|
+
</div>
|
|
154
|
+
<div className="flex gap-3">
|
|
155
|
+
{preferencesModal === true ? <UserPreferencesModal /> : null}
|
|
156
|
+
<ShareButton
|
|
157
|
+
profileSource={profileSource}
|
|
158
|
+
queryClient={queryClient}
|
|
159
|
+
queryRequest={profileSource?.QueryRequest() ?? undefined}
|
|
160
|
+
onDownloadPProf={onDownloadPProf}
|
|
161
|
+
pprofdownloading={pprofdownloading ?? false}
|
|
162
|
+
profileViewExternalSubActions={profileViewExternalSubActions}
|
|
163
|
+
/>
|
|
164
|
+
<ViewSelector />
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export default VisualisationToolbar;
|
package/src/index.tsx
CHANGED
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
|
|
14
14
|
import type {Props as CallgraphProps} from './Callgraph';
|
|
15
|
+
import {useLabelNames} from './MatchersInput';
|
|
15
16
|
import ProfileExplorer, {getExpressionAsAString} from './ProfileExplorer';
|
|
16
17
|
import ProfileTypeSelector from './ProfileTypeSelector';
|
|
18
|
+
import CustomSelect from './SimpleMatchers/Select';
|
|
17
19
|
|
|
18
20
|
export * from './ProfileIcicleGraph/IcicleGraph';
|
|
19
21
|
export * from './ProfileIcicleGraph';
|
|
@@ -31,4 +33,4 @@ export const DEFAULT_PROFILE_EXPLORER_PARAM_VALUES = {
|
|
|
31
33
|
|
|
32
34
|
export type {CallgraphProps};
|
|
33
35
|
|
|
34
|
-
export {ProfileExplorer, ProfileTypeSelector, getExpressionAsAString};
|
|
36
|
+
export {ProfileExplorer, ProfileTypeSelector, getExpressionAsAString, CustomSelect, useLabelNames};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupByDropdown.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/ActionButtons/GroupByDropdown.tsx"],"names":[],"mappings":"AAyDA,QAAA,MAAM,eAAe,gCAGlB;IACD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,KAAG,KAAK,CAAC,GAAG,CAAC,OA6Db,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SortBySelect.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/ActionButtons/SortBySelect.tsx"],"names":[],"mappings":"AAiBA,QAAA,MAAM,YAAY,wCAIf;IACD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,OAAO,CAAC;CACtB,KAAG,KAAK,CAAC,GAAG,CAAC,OAqDb,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// Copyright 2022 The Parca Authors
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
import { Select } from '@parca/components';
|
|
15
|
-
import { FIELD_CUMULATIVE, FIELD_DIFF, FIELD_FUNCTION_NAME } from '../IcicleGraphArrow';
|
|
16
|
-
const SortBySelect = ({ sortBy, setSortBy, compareMode, }) => {
|
|
17
|
-
return (_jsxs("div", { children: [_jsx("label", { className: "text-sm", children: "Sort" }), _jsx(Select, { className: "!px-3", items: [
|
|
18
|
-
{
|
|
19
|
-
key: FIELD_FUNCTION_NAME,
|
|
20
|
-
disabled: false,
|
|
21
|
-
element: {
|
|
22
|
-
active: _jsx(_Fragment, { children: "Function" }),
|
|
23
|
-
expanded: (_jsx(_Fragment, { children: _jsx("span", { children: "Function" }) })),
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
key: FIELD_CUMULATIVE,
|
|
28
|
-
disabled: false,
|
|
29
|
-
element: {
|
|
30
|
-
active: _jsx(_Fragment, { children: "Cumulative" }),
|
|
31
|
-
expanded: (_jsx(_Fragment, { children: _jsx("span", { children: "Cumulative" }) })),
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: FIELD_DIFF,
|
|
36
|
-
disabled: !compareMode,
|
|
37
|
-
element: {
|
|
38
|
-
active: _jsx(_Fragment, { children: "Diff" }),
|
|
39
|
-
expanded: (_jsx(_Fragment, { children: _jsx("span", { children: "Diff" }) })),
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
], selectedKey: sortBy, onSelection: key => setSortBy(key), placeholder: 'Sort By', primary: false, disabled: false, id: "h-sort-by-filter" })] }));
|
|
43
|
-
};
|
|
44
|
-
export default SortBySelect;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FilterByFunctionButton.d.ts","sourceRoot":"","sources":["../../src/ProfileView/FilterByFunctionButton.tsx"],"names":[],"mappings":"AAoBA,QAAA,MAAM,sBAAsB,QAAO,GAAG,CAAC,OAuCtC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
position: number;
|
|
3
|
-
defaultValue: string;
|
|
4
|
-
placeholderText?: string;
|
|
5
|
-
primary?: boolean;
|
|
6
|
-
addView?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
icon?: JSX.Element;
|
|
9
|
-
id?: string;
|
|
10
|
-
}
|
|
11
|
-
declare const ViewSelector: ({ defaultValue, position, placeholderText, primary, addView, disabled, icon, id, }: Props) => JSX.Element;
|
|
12
|
-
export default ViewSelector;
|
|
13
|
-
//# sourceMappingURL=ViewSelector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewSelector.d.ts","sourceRoot":"","sources":["../../src/ProfileView/ViewSelector.tsx"],"names":[],"mappings":"AAeA,UAAU,KAAK;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,YAAY,uFASf,KAAK,KAAG,GAAG,CAAC,OA6Ed,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResultBox.d.ts","sourceRoot":"","sources":["../../../src/components/ProfileShareButton/ResultBox.tsx"],"names":[],"mappings":"AAoBA,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,QAAA,MAAM,SAAS,yBAA6B,KAAK,KAAG,GAAG,CAAC,OAqCvD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { QueryRequest, QueryServiceClient } from '@parca/client';
|
|
2
|
-
interface Props {
|
|
3
|
-
queryRequest: QueryRequest;
|
|
4
|
-
queryClient: QueryServiceClient;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const ProfileShareButton: ({ queryRequest, queryClient, disabled }: Props) => JSX.Element;
|
|
8
|
-
export default ProfileShareButton;
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ProfileShareButton/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAK/D,UAAU,KAAK;IACb,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,kBAAkB,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAkGD,QAAA,MAAM,kBAAkB,4CAAmD,KAAK,KAAG,GAAG,CAAC,OAuBtF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Parca Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
|
|
14
|
-
import {Select} from '@parca/components';
|
|
15
|
-
|
|
16
|
-
import {FIELD_CUMULATIVE, FIELD_DIFF, FIELD_FUNCTION_NAME} from '../IcicleGraphArrow';
|
|
17
|
-
|
|
18
|
-
const SortBySelect = ({
|
|
19
|
-
sortBy,
|
|
20
|
-
setSortBy,
|
|
21
|
-
compareMode,
|
|
22
|
-
}: {
|
|
23
|
-
sortBy: string;
|
|
24
|
-
setSortBy: (key: string) => void;
|
|
25
|
-
compareMode: boolean;
|
|
26
|
-
}): React.JSX.Element => {
|
|
27
|
-
return (
|
|
28
|
-
<div>
|
|
29
|
-
<label className="text-sm">Sort</label>
|
|
30
|
-
<Select
|
|
31
|
-
className="!px-3"
|
|
32
|
-
items={[
|
|
33
|
-
{
|
|
34
|
-
key: FIELD_FUNCTION_NAME,
|
|
35
|
-
disabled: false,
|
|
36
|
-
element: {
|
|
37
|
-
active: <>Function</>,
|
|
38
|
-
expanded: (
|
|
39
|
-
<>
|
|
40
|
-
<span>Function</span>
|
|
41
|
-
</>
|
|
42
|
-
),
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: FIELD_CUMULATIVE,
|
|
47
|
-
disabled: false,
|
|
48
|
-
element: {
|
|
49
|
-
active: <>Cumulative</>,
|
|
50
|
-
expanded: (
|
|
51
|
-
<>
|
|
52
|
-
<span>Cumulative</span>
|
|
53
|
-
</>
|
|
54
|
-
),
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
key: FIELD_DIFF,
|
|
59
|
-
disabled: !compareMode,
|
|
60
|
-
element: {
|
|
61
|
-
active: <>Diff</>,
|
|
62
|
-
expanded: (
|
|
63
|
-
<>
|
|
64
|
-
<span>Diff</span>
|
|
65
|
-
</>
|
|
66
|
-
),
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
]}
|
|
70
|
-
selectedKey={sortBy}
|
|
71
|
-
onSelection={key => setSortBy(key)}
|
|
72
|
-
placeholder={'Sort By'}
|
|
73
|
-
primary={false}
|
|
74
|
-
disabled={false}
|
|
75
|
-
id="h-sort-by-filter"
|
|
76
|
-
/>
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export default SortBySelect;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|