@parca/profile 0.19.10 → 0.19.11
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 +4 -0
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.d.ts +0 -1
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +4 -141
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.d.ts +8 -0
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.d.ts.map +1 -0
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +57 -0
- package/dist/ProfileView/components/InvertCallStack/index.d.ts +3 -0
- package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -0
- package/dist/ProfileView/components/InvertCallStack/index.js +21 -0
- package/dist/ProfileView/components/ShareButton/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ShareButton/index.js +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts +3 -0
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +78 -20
- package/dist/ProfileView/components/Toolbars/SwitchMenuItem.d.ts +9 -0
- package/dist/ProfileView/components/Toolbars/SwitchMenuItem.d.ts.map +1 -0
- package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +22 -0
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +4 -1
- package/dist/ProfileView/components/ViewSelector/Dropdown.js +1 -1
- package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/index.js +9 -12
- package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useVisualizationState.js +16 -6
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/src/ProfileView/components/ActionButtons/GroupByDropdown.tsx +7 -323
- package/src/ProfileView/components/GroupByLabelsDropdown/index.tsx +92 -0
- package/src/ProfileView/components/InvertCallStack/index.tsx +34 -0
- package/src/ProfileView/components/ShareButton/index.tsx +8 -4
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +134 -22
- package/src/ProfileView/components/Toolbars/SwitchMenuItem.tsx +50 -0
- package/src/ProfileView/components/Toolbars/index.tsx +25 -9
- package/src/ProfileView/components/ViewSelector/Dropdown.tsx +1 -1
- package/src/ProfileView/components/ViewSelector/index.tsx +15 -19
- package/src/ProfileView/hooks/useVisualizationState.ts +25 -6
|
@@ -11,11 +11,17 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
|
|
14
|
-
import {useCallback, useState} from 'react';
|
|
14
|
+
import {useCallback, useMemo, useState} from 'react';
|
|
15
15
|
|
|
16
16
|
import {JSONParser, JSONSerializer, useURLState, useURLStateCustom} from '@parca/components';
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
FIELD_FUNCTION_FILE_NAME,
|
|
20
|
+
FIELD_FUNCTION_NAME,
|
|
21
|
+
FIELD_LABELS,
|
|
22
|
+
FIELD_LOCATION_ADDRESS,
|
|
23
|
+
FIELD_MAPPING_FILE,
|
|
24
|
+
} from '../../ProfileIcicleGraph/IcicleGraphArrow';
|
|
19
25
|
import {CurrentPathFrame} from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
|
|
20
26
|
|
|
21
27
|
export const useVisualizationState = (): {
|
|
@@ -54,6 +60,16 @@ export const useVisualizationState = (): {
|
|
|
54
60
|
'sandwich_function_name'
|
|
55
61
|
);
|
|
56
62
|
|
|
63
|
+
const levelsOfProfiling = useMemo(
|
|
64
|
+
() => [
|
|
65
|
+
FIELD_FUNCTION_NAME,
|
|
66
|
+
FIELD_FUNCTION_FILE_NAME,
|
|
67
|
+
FIELD_LOCATION_ADDRESS,
|
|
68
|
+
FIELD_MAPPING_FILE,
|
|
69
|
+
],
|
|
70
|
+
[]
|
|
71
|
+
);
|
|
72
|
+
|
|
57
73
|
const setGroupBy = useCallback(
|
|
58
74
|
(keys: string[]): void => {
|
|
59
75
|
setStoreGroupBy(keys);
|
|
@@ -63,11 +79,14 @@ export const useVisualizationState = (): {
|
|
|
63
79
|
|
|
64
80
|
const toggleGroupBy = useCallback(
|
|
65
81
|
(key: string): void => {
|
|
66
|
-
groupBy.includes(key)
|
|
67
|
-
|
|
68
|
-
|
|
82
|
+
if (groupBy.includes(key)) {
|
|
83
|
+
setGroupBy(groupBy.filter(v => v !== key)); // remove
|
|
84
|
+
} else {
|
|
85
|
+
const filteredGroupBy = groupBy.filter(item => !levelsOfProfiling.includes(item));
|
|
86
|
+
setGroupBy([...filteredGroupBy, key]); // add
|
|
87
|
+
}
|
|
69
88
|
},
|
|
70
|
-
[groupBy, setGroupBy]
|
|
89
|
+
[groupBy, setGroupBy, levelsOfProfiling]
|
|
71
90
|
);
|
|
72
91
|
|
|
73
92
|
const setGroupByLabels = useCallback(
|