@parca/profile 0.16.426 → 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.
Files changed (68) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.js +1 -1
  3. package/dist/ProfileIcicleGraph/index.d.ts +1 -1
  4. package/dist/ProfileIcicleGraph/index.d.ts.map +1 -1
  5. package/dist/ProfileIcicleGraph/index.js +4 -59
  6. package/dist/ProfileView/VisualizationPanel.d.ts.map +1 -1
  7. package/dist/ProfileView/VisualizationPanel.js +2 -3
  8. package/dist/ProfileView/index.d.ts.map +1 -1
  9. package/dist/ProfileView/index.js +21 -14
  10. package/dist/Table/ColumnsVisibility.js +1 -1
  11. package/dist/Table/index.d.ts +6 -0
  12. package/dist/Table/index.d.ts.map +1 -1
  13. package/dist/Table/index.js +45 -21
  14. package/dist/components/ActionButtons/GroupByDropdown.d.ts.map +1 -0
  15. package/dist/{ProfileIcicleGraph → components}/ActionButtons/GroupByDropdown.js +1 -1
  16. package/dist/components/FilterByFunctionButton.d.ts.map +1 -0
  17. package/dist/components/ShareButton/ResultBox.d.ts.map +1 -0
  18. package/dist/components/ShareButton/index.d.ts +14 -0
  19. package/dist/components/ShareButton/index.d.ts.map +1 -0
  20. package/dist/components/{ProfileShareButton → ShareButton}/index.js +28 -5
  21. package/dist/components/ViewSelector/Dropdown.d.ts +30 -0
  22. package/dist/components/ViewSelector/Dropdown.d.ts.map +1 -0
  23. package/dist/components/ViewSelector/Dropdown.js +41 -0
  24. package/dist/components/ViewSelector/index.d.ts +3 -0
  25. package/dist/components/ViewSelector/index.d.ts.map +1 -0
  26. package/dist/{ProfileView/ViewSelector.js → components/ViewSelector/index.js} +25 -12
  27. package/dist/components/VisualisationToolbar/MultiLevelDropdown.d.ts +9 -0
  28. package/dist/components/VisualisationToolbar/MultiLevelDropdown.d.ts.map +1 -0
  29. package/dist/components/VisualisationToolbar/MultiLevelDropdown.js +123 -0
  30. package/dist/components/VisualisationToolbar/TableColumnsDropdown.d.ts +9 -0
  31. package/dist/components/VisualisationToolbar/TableColumnsDropdown.d.ts.map +1 -0
  32. package/dist/components/VisualisationToolbar/TableColumnsDropdown.js +189 -0
  33. package/dist/components/VisualisationToolbar/index.d.ts +25 -0
  34. package/dist/components/VisualisationToolbar/index.d.ts.map +1 -0
  35. package/dist/components/VisualisationToolbar/index.js +55 -0
  36. package/dist/styles.css +1 -1
  37. package/package.json +4 -4
  38. package/src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx +1 -1
  39. package/src/ProfileIcicleGraph/index.tsx +3 -206
  40. package/src/ProfileView/VisualizationPanel.tsx +1 -6
  41. package/src/ProfileView/index.tsx +46 -56
  42. package/src/Table/ColumnsVisibility.tsx +1 -1
  43. package/src/Table/index.tsx +64 -42
  44. package/src/{ProfileIcicleGraph → components}/ActionButtons/GroupByDropdown.tsx +1 -1
  45. package/src/components/{ProfileShareButton → ShareButton}/index.tsx +88 -24
  46. package/src/components/ViewSelector/Dropdown.tsx +181 -0
  47. package/src/{ProfileView/ViewSelector.tsx → components/ViewSelector/index.tsx} +32 -39
  48. package/src/components/VisualisationToolbar/MultiLevelDropdown.tsx +258 -0
  49. package/src/components/VisualisationToolbar/TableColumnsDropdown.tsx +222 -0
  50. package/src/components/VisualisationToolbar/index.tsx +171 -0
  51. package/dist/ProfileIcicleGraph/ActionButtons/GroupByDropdown.d.ts.map +0 -1
  52. package/dist/ProfileIcicleGraph/ActionButtons/SortBySelect.d.ts +0 -7
  53. package/dist/ProfileIcicleGraph/ActionButtons/SortBySelect.d.ts.map +0 -1
  54. package/dist/ProfileIcicleGraph/ActionButtons/SortBySelect.js +0 -44
  55. package/dist/ProfileView/FilterByFunctionButton.d.ts.map +0 -1
  56. package/dist/ProfileView/ViewSelector.d.ts +0 -13
  57. package/dist/ProfileView/ViewSelector.d.ts.map +0 -1
  58. package/dist/components/ProfileShareButton/ResultBox.d.ts.map +0 -1
  59. package/dist/components/ProfileShareButton/index.d.ts +0 -9
  60. package/dist/components/ProfileShareButton/index.d.ts.map +0 -1
  61. package/src/ProfileIcicleGraph/ActionButtons/SortBySelect.tsx +0 -81
  62. /package/dist/{ProfileIcicleGraph → components}/ActionButtons/GroupByDropdown.d.ts +0 -0
  63. /package/dist/{ProfileView → components}/FilterByFunctionButton.d.ts +0 -0
  64. /package/dist/{ProfileView → components}/FilterByFunctionButton.js +0 -0
  65. /package/dist/components/{ProfileShareButton → ShareButton}/ResultBox.d.ts +0 -0
  66. /package/dist/components/{ProfileShareButton → ShareButton}/ResultBox.js +0 -0
  67. /package/src/{ProfileView → components}/FilterByFunctionButton.tsx +0 -0
  68. /package/src/components/{ProfileShareButton → ShareButton}/ResultBox.tsx +0 -0
@@ -0,0 +1,222 @@
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 {useEffect, useMemo, useState} from 'react';
15
+
16
+ import {createColumnHelper, type CellContext, type ColumnDef} from '@tanstack/table-core';
17
+
18
+ import {useURLState} from '@parca/components';
19
+ import {ProfileType} from '@parca/parser';
20
+ import {valueFormatter} from '@parca/utilities';
21
+
22
+ import {useProfileViewContext} from '../../ProfileView/ProfileViewContext';
23
+ import {ColumnName, DataRow, Row, addPlusSign, getRatioString, isDummyRow} from '../../Table';
24
+ import ColumnsVisibility from '../../Table/ColumnsVisibility';
25
+
26
+ interface Props {
27
+ profileType?: ProfileType;
28
+ total: bigint;
29
+ filtered: bigint;
30
+ }
31
+
32
+ const TableColumnsDropdown = ({profileType, total, filtered}: Props): JSX.Element => {
33
+ const {compareMode} = useProfileViewContext();
34
+ const [tableColumns, setTableColumns] = useURLState<string[]>('table_columns', {
35
+ alwaysReturnArray: true,
36
+ });
37
+
38
+ const columnHelper = createColumnHelper<Row>();
39
+
40
+ const unit: string = useMemo(() => profileType?.sampleUnit ?? '', [profileType?.sampleUnit]);
41
+
42
+ const columns = useMemo<Array<ColumnDef<Row>>>(() => {
43
+ return [
44
+ columnHelper.accessor('flat', {
45
+ id: 'flat',
46
+ header: 'Flat',
47
+ cell: info => valueFormatter((info as CellContext<DataRow, bigint>).getValue(), unit, 2),
48
+ size: 80,
49
+ meta: {
50
+ align: 'right',
51
+ },
52
+ invertSorting: true,
53
+ }),
54
+ columnHelper.accessor('flat', {
55
+ id: 'flatPercentage',
56
+ header: 'Flat (%)',
57
+ cell: info => {
58
+ if (isDummyRow(info.row.original)) {
59
+ return '';
60
+ }
61
+ return getRatioString((info as CellContext<DataRow, bigint>).getValue(), total, filtered);
62
+ },
63
+ size: 120,
64
+ meta: {
65
+ align: 'right',
66
+ },
67
+ invertSorting: true,
68
+ }),
69
+ columnHelper.accessor('flatDiff', {
70
+ id: 'flatDiff',
71
+ header: 'Flat Diff',
72
+ cell: info =>
73
+ addPlusSign(valueFormatter((info as CellContext<DataRow, bigint>).getValue(), unit, 2)),
74
+ size: 120,
75
+ meta: {
76
+ align: 'right',
77
+ },
78
+ invertSorting: true,
79
+ }),
80
+ columnHelper.accessor('flatDiff', {
81
+ id: 'flatDiffPercentage',
82
+ header: 'Flat Diff (%)',
83
+ cell: info => {
84
+ if (isDummyRow(info.row.original)) {
85
+ return '';
86
+ }
87
+ return getRatioString((info as CellContext<DataRow, bigint>).getValue(), total, filtered);
88
+ },
89
+ size: 120,
90
+ meta: {
91
+ align: 'right',
92
+ },
93
+ invertSorting: true,
94
+ }),
95
+ columnHelper.accessor('cumulative', {
96
+ id: 'cumulative',
97
+ header: 'Cumulative',
98
+ cell: info => valueFormatter((info as CellContext<DataRow, bigint>).getValue(), unit, 2),
99
+ size: 150,
100
+ meta: {
101
+ align: 'right',
102
+ },
103
+ invertSorting: true,
104
+ }),
105
+ columnHelper.accessor('cumulative', {
106
+ id: 'cumulativePercentage',
107
+ header: 'Cumulative (%)',
108
+ cell: info => {
109
+ if (isDummyRow(info.row.original)) {
110
+ return '';
111
+ }
112
+ return getRatioString((info as CellContext<DataRow, bigint>).getValue(), total, filtered);
113
+ },
114
+ size: 150,
115
+ meta: {
116
+ align: 'right',
117
+ },
118
+ invertSorting: true,
119
+ }),
120
+ columnHelper.accessor('cumulativeDiff', {
121
+ id: 'cumulativeDiff',
122
+ header: 'Cumulative Diff',
123
+ cell: info =>
124
+ addPlusSign(valueFormatter((info as CellContext<DataRow, bigint>).getValue(), unit, 2)),
125
+ size: 170,
126
+ meta: {
127
+ align: 'right',
128
+ },
129
+ invertSorting: true,
130
+ }),
131
+ columnHelper.accessor('cumulativeDiff', {
132
+ id: 'cumulativeDiffPercentage',
133
+ header: 'Cumulative Diff (%)',
134
+ cell: info => {
135
+ if (isDummyRow(info.row.original)) {
136
+ return '';
137
+ }
138
+ return getRatioString((info as CellContext<DataRow, bigint>).getValue(), total, filtered);
139
+ },
140
+ size: 170,
141
+ meta: {
142
+ align: 'right',
143
+ },
144
+ invertSorting: true,
145
+ }),
146
+ columnHelper.accessor('name', {
147
+ id: 'name',
148
+ header: 'Name',
149
+ cell: info => info.getValue(),
150
+ }),
151
+ columnHelper.accessor('functionSystemName', {
152
+ id: 'functionSystemName',
153
+ header: 'Function System Name',
154
+ cell: info => info.getValue(),
155
+ }),
156
+ columnHelper.accessor('functionFileName', {
157
+ id: 'functionFileName',
158
+ header: 'Function File Name',
159
+ cell: info => info.getValue(),
160
+ }),
161
+ columnHelper.accessor('mappingFile', {
162
+ id: 'mappingFile',
163
+ header: 'Mapping File',
164
+ cell: info => info.getValue(),
165
+ }),
166
+ ];
167
+ // eslint-disable-next-line react-hooks/exhaustive-deps
168
+ }, [profileType, unit]);
169
+
170
+ const [columnVisibility, setColumnVisibility] = useState(() => {
171
+ return {
172
+ flat: true,
173
+ flatPercentage: false,
174
+ flatDiff: compareMode,
175
+ flatDiffPercentage: false,
176
+ cumulative: true,
177
+ cumulativePercentage: false,
178
+ cumulativeDiff: compareMode,
179
+ cumulativeDiffPercentage: false,
180
+ name: true,
181
+ functionSystemName: false,
182
+ functionFileName: false,
183
+ mappingFile: false,
184
+ };
185
+ });
186
+
187
+ useEffect(() => {
188
+ if (Array.isArray(tableColumns)) {
189
+ setColumnVisibility(prevState => {
190
+ const newState = {...prevState};
191
+ (Object.keys(newState) as ColumnName[]).forEach(column => {
192
+ newState[column] = tableColumns.includes(column);
193
+ });
194
+ return newState;
195
+ });
196
+ }
197
+ }, [tableColumns]);
198
+
199
+ const updateColumnVisibility = (column: string, isVisible: boolean): void => {
200
+ const updatedColumns = {...columnVisibility, [column]: isVisible};
201
+
202
+ const newTableColumns = (Object.keys(updatedColumns) as ColumnName[]).filter(
203
+ col => updatedColumns[col]
204
+ );
205
+ setTableColumns(newTableColumns);
206
+ };
207
+
208
+ return (
209
+ <div className="flex flex-col gap-1">
210
+ <label className="text-sm">Table Columns</label>
211
+ <ColumnsVisibility
212
+ columns={columns}
213
+ visibility={columnVisibility}
214
+ setVisibility={(id, visible) => {
215
+ updateColumnVisibility(id, visible);
216
+ }}
217
+ />
218
+ </div>
219
+ );
220
+ };
221
+
222
+ export default TableColumnsDropdown;
@@ -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;
@@ -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,7 +0,0 @@
1
- declare const SortBySelect: ({ sortBy, setSortBy, compareMode, }: {
2
- sortBy: string;
3
- setSortBy: (key: string) => void;
4
- compareMode: boolean;
5
- }) => React.JSX.Element;
6
- export default SortBySelect;
7
- //# sourceMappingURL=SortBySelect.d.ts.map
@@ -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;