@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.
Files changed (37) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.d.ts +0 -1
  3. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.d.ts.map +1 -1
  4. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +4 -141
  5. package/dist/ProfileView/components/GroupByLabelsDropdown/index.d.ts +8 -0
  6. package/dist/ProfileView/components/GroupByLabelsDropdown/index.d.ts.map +1 -0
  7. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +57 -0
  8. package/dist/ProfileView/components/InvertCallStack/index.d.ts +3 -0
  9. package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -0
  10. package/dist/ProfileView/components/InvertCallStack/index.js +21 -0
  11. package/dist/ProfileView/components/ShareButton/index.d.ts.map +1 -1
  12. package/dist/ProfileView/components/ShareButton/index.js +1 -1
  13. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts +3 -0
  14. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  15. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +78 -20
  16. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.d.ts +9 -0
  17. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.d.ts.map +1 -0
  18. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +22 -0
  19. package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
  20. package/dist/ProfileView/components/Toolbars/index.js +4 -1
  21. package/dist/ProfileView/components/ViewSelector/Dropdown.js +1 -1
  22. package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
  23. package/dist/ProfileView/components/ViewSelector/index.js +9 -12
  24. package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
  25. package/dist/ProfileView/hooks/useVisualizationState.js +16 -6
  26. package/dist/styles.css +1 -1
  27. package/package.json +2 -2
  28. package/src/ProfileView/components/ActionButtons/GroupByDropdown.tsx +7 -323
  29. package/src/ProfileView/components/GroupByLabelsDropdown/index.tsx +92 -0
  30. package/src/ProfileView/components/InvertCallStack/index.tsx +34 -0
  31. package/src/ProfileView/components/ShareButton/index.tsx +8 -4
  32. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +134 -22
  33. package/src/ProfileView/components/Toolbars/SwitchMenuItem.tsx +50 -0
  34. package/src/ProfileView/components/Toolbars/index.tsx +25 -9
  35. package/src/ProfileView/components/ViewSelector/Dropdown.tsx +1 -1
  36. package/src/ProfileView/components/ViewSelector/index.tsx +15 -19
  37. 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 {FIELD_FUNCTION_NAME, FIELD_LABELS} from '../../ProfileIcicleGraph/IcicleGraphArrow';
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
- ? setGroupBy(groupBy.filter(v => v !== key)) // remove
68
- : setGroupBy([...groupBy, key]); // add
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(