@parca/profile 0.16.450 → 0.16.451

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 (138) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +1 -1
  3. package/dist/ProfileIcicleGraph/IcicleGraph/index.js +1 -1
  4. package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.js +1 -1
  5. package/dist/ProfileIcicleGraph/index.js +2 -2
  6. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.d.ts.map +1 -0
  7. package/dist/{components → ProfileView/components}/ActionButtons/GroupByDropdown.js +1 -1
  8. package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -0
  9. package/dist/{components → ProfileView/components}/ActionButtons/SortByDropdown.js +2 -2
  10. package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -0
  11. package/dist/ProfileView/{ColorStackLegend.js → components/ColorStackLegend.js} +2 -2
  12. package/dist/ProfileView/components/DashboardItems/index.d.ts +26 -0
  13. package/dist/ProfileView/components/DashboardItems/index.d.ts.map +1 -0
  14. package/dist/ProfileView/components/DashboardItems/index.js +42 -0
  15. package/dist/ProfileView/components/DashboardLayout/index.d.ts +15 -0
  16. package/dist/ProfileView/components/DashboardLayout/index.d.ts.map +1 -0
  17. package/dist/ProfileView/components/DashboardLayout/index.js +20 -0
  18. package/dist/ProfileView/components/DiffLegend.d.ts.map +1 -0
  19. package/dist/ProfileView/components/FilterByFunctionButton.d.ts.map +1 -0
  20. package/dist/ProfileView/components/ProfileHeader/index.d.ts +9 -0
  21. package/dist/ProfileView/components/ProfileHeader/index.d.ts.map +1 -0
  22. package/dist/ProfileView/components/ProfileHeader/index.js +12 -0
  23. package/dist/ProfileView/components/ShareButton/ResultBox.d.ts.map +1 -0
  24. package/dist/{components → ProfileView/components}/ShareButton/index.d.ts +1 -1
  25. package/dist/ProfileView/components/ShareButton/index.d.ts.map +1 -0
  26. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -0
  27. package/dist/{components/VisualisationToolbar → ProfileView/components/Toolbars}/MultiLevelDropdown.js +2 -2
  28. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -0
  29. package/dist/{components/VisualisationToolbar → ProfileView/components/Toolbars}/TableColumnsDropdown.js +4 -4
  30. package/dist/ProfileView/components/Toolbars/index.d.ts +41 -0
  31. package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -0
  32. package/dist/ProfileView/components/Toolbars/index.js +24 -0
  33. package/dist/ProfileView/components/ViewSelector/Dropdown.d.ts.map +1 -0
  34. package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -0
  35. package/dist/ProfileView/components/VisualizationContainer/index.d.ts +21 -0
  36. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -0
  37. package/dist/ProfileView/components/VisualizationContainer/index.js +8 -0
  38. package/dist/ProfileView/{VisualizationPanel.d.ts → components/VisualizationPanel.d.ts} +4 -3
  39. package/dist/ProfileView/components/VisualizationPanel.d.ts.map +1 -0
  40. package/dist/ProfileView/context/DashboardContext.d.ts +12 -0
  41. package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -0
  42. package/dist/ProfileView/context/DashboardContext.js +39 -0
  43. package/dist/ProfileView/{ProfileViewContext.d.ts → context/ProfileViewContext.d.ts} +1 -1
  44. package/dist/ProfileView/context/ProfileViewContext.d.ts.map +1 -0
  45. package/dist/ProfileView/hooks/useGraphviz.d.ts +12 -0
  46. package/dist/ProfileView/hooks/useGraphviz.d.ts.map +1 -0
  47. package/dist/ProfileView/hooks/useGraphviz.js +42 -0
  48. package/dist/ProfileView/hooks/useProfileMetadata.d.ts +17 -0
  49. package/dist/ProfileView/hooks/useProfileMetadata.d.ts.map +1 -0
  50. package/dist/ProfileView/hooks/useProfileMetadata.js +30 -0
  51. package/dist/ProfileView/hooks/useVisualizationState.d.ts +14 -0
  52. package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -0
  53. package/dist/ProfileView/hooks/useVisualizationState.js +52 -0
  54. package/dist/ProfileView/index.d.ts +2 -49
  55. package/dist/ProfileView/index.d.ts.map +1 -1
  56. package/dist/ProfileView/index.js +54 -173
  57. package/dist/ProfileView/types/visualization.d.ts +49 -0
  58. package/dist/ProfileView/types/visualization.d.ts.map +1 -0
  59. package/dist/ProfileView/types/visualization.js +13 -0
  60. package/dist/ProfileView/utils/colorUtils.d.ts +3 -0
  61. package/dist/ProfileView/utils/colorUtils.d.ts.map +1 -0
  62. package/dist/ProfileView/utils/colorUtils.js +21 -0
  63. package/dist/ProfileViewWithData.d.ts +2 -1
  64. package/dist/ProfileViewWithData.d.ts.map +1 -1
  65. package/dist/ProfileViewWithData.js +2 -2
  66. package/dist/SourceView/Highlighter.js +1 -1
  67. package/dist/Table/index.js +1 -1
  68. package/dist/TopTable/index.js +1 -1
  69. package/dist/styles.css +1 -1
  70. package/package.json +2 -2
  71. package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +1 -1
  72. package/src/ProfileIcicleGraph/IcicleGraph/index.tsx +1 -1
  73. package/src/ProfileIcicleGraph/IcicleGraphArrow/index.tsx +1 -1
  74. package/src/ProfileIcicleGraph/index.tsx +2 -2
  75. package/src/{components → ProfileView/components}/ActionButtons/GroupByDropdown.tsx +1 -1
  76. package/src/{components → ProfileView/components}/ActionButtons/SortByDropdown.tsx +2 -2
  77. package/src/ProfileView/{ColorStackLegend.tsx → components/ColorStackLegend.tsx} +2 -2
  78. package/src/ProfileView/components/DashboardItems/index.tsx +148 -0
  79. package/src/ProfileView/components/DashboardLayout/index.tsx +96 -0
  80. package/src/ProfileView/components/ProfileHeader/index.tsx +68 -0
  81. package/src/{components → ProfileView/components}/ShareButton/index.tsx +1 -1
  82. package/src/{components/VisualisationToolbar → ProfileView/components/Toolbars}/MultiLevelDropdown.tsx +2 -6
  83. package/src/{components/VisualisationToolbar → ProfileView/components/Toolbars}/TableColumnsDropdown.tsx +4 -4
  84. package/src/ProfileView/components/Toolbars/index.tsx +193 -0
  85. package/src/ProfileView/components/VisualizationContainer/index.tsx +68 -0
  86. package/src/ProfileView/{VisualizationPanel.tsx → components/VisualizationPanel.tsx} +5 -3
  87. package/src/ProfileView/context/DashboardContext.tsx +61 -0
  88. package/src/ProfileView/{ProfileViewContext.tsx → context/ProfileViewContext.tsx} +1 -1
  89. package/src/ProfileView/hooks/useGraphviz.ts +69 -0
  90. package/src/ProfileView/hooks/useProfileMetadata.ts +59 -0
  91. package/src/ProfileView/hooks/useVisualizationState.ts +82 -0
  92. package/src/ProfileView/index.tsx +126 -451
  93. package/src/ProfileView/types/visualization.ts +75 -0
  94. package/src/ProfileView/utils/colorUtils.ts +24 -0
  95. package/src/ProfileViewWithData.tsx +3 -0
  96. package/src/SourceView/Highlighter.tsx +1 -1
  97. package/src/Table/index.tsx +1 -1
  98. package/src/TopTable/index.tsx +1 -1
  99. package/dist/ProfileView/ColorStackLegend.d.ts.map +0 -1
  100. package/dist/ProfileView/ProfileViewContext.d.ts.map +0 -1
  101. package/dist/ProfileView/VisualizationPanel.d.ts.map +0 -1
  102. package/dist/components/ActionButtons/GroupByDropdown.d.ts.map +0 -1
  103. package/dist/components/ActionButtons/SortByDropdown.d.ts.map +0 -1
  104. package/dist/components/DiffLegend.d.ts.map +0 -1
  105. package/dist/components/FilterByFunctionButton.d.ts.map +0 -1
  106. package/dist/components/ShareButton/ResultBox.d.ts.map +0 -1
  107. package/dist/components/ShareButton/index.d.ts.map +0 -1
  108. package/dist/components/ViewSelector/Dropdown.d.ts.map +0 -1
  109. package/dist/components/ViewSelector/index.d.ts.map +0 -1
  110. package/dist/components/VisualisationToolbar/MultiLevelDropdown.d.ts.map +0 -1
  111. package/dist/components/VisualisationToolbar/TableColumnsDropdown.d.ts.map +0 -1
  112. package/dist/components/VisualisationToolbar/index.d.ts +0 -37
  113. package/dist/components/VisualisationToolbar/index.d.ts.map +0 -1
  114. package/dist/components/VisualisationToolbar/index.js +0 -64
  115. package/src/components/VisualisationToolbar/index.tsx +0 -228
  116. /package/dist/{components → ProfileView/components}/ActionButtons/GroupByDropdown.d.ts +0 -0
  117. /package/dist/{components → ProfileView/components}/ActionButtons/SortByDropdown.d.ts +0 -0
  118. /package/dist/ProfileView/{ColorStackLegend.d.ts → components/ColorStackLegend.d.ts} +0 -0
  119. /package/dist/{components → ProfileView/components}/DiffLegend.d.ts +0 -0
  120. /package/dist/{components → ProfileView/components}/DiffLegend.js +0 -0
  121. /package/dist/{components → ProfileView/components}/FilterByFunctionButton.d.ts +0 -0
  122. /package/dist/{components → ProfileView/components}/FilterByFunctionButton.js +0 -0
  123. /package/dist/{components → ProfileView/components}/ShareButton/ResultBox.d.ts +0 -0
  124. /package/dist/{components → ProfileView/components}/ShareButton/ResultBox.js +0 -0
  125. /package/dist/{components → ProfileView/components}/ShareButton/index.js +0 -0
  126. /package/dist/{components/VisualisationToolbar → ProfileView/components/Toolbars}/MultiLevelDropdown.d.ts +0 -0
  127. /package/dist/{components/VisualisationToolbar → ProfileView/components/Toolbars}/TableColumnsDropdown.d.ts +0 -0
  128. /package/dist/{components → ProfileView/components}/ViewSelector/Dropdown.d.ts +0 -0
  129. /package/dist/{components → ProfileView/components}/ViewSelector/Dropdown.js +0 -0
  130. /package/dist/{components → ProfileView/components}/ViewSelector/index.d.ts +0 -0
  131. /package/dist/{components → ProfileView/components}/ViewSelector/index.js +0 -0
  132. /package/dist/ProfileView/{VisualizationPanel.js → components/VisualizationPanel.js} +0 -0
  133. /package/dist/ProfileView/{ProfileViewContext.js → context/ProfileViewContext.js} +0 -0
  134. /package/src/{components → ProfileView/components}/DiffLegend.tsx +0 -0
  135. /package/src/{components → ProfileView/components}/FilterByFunctionButton.tsx +0 -0
  136. /package/src/{components → ProfileView/components}/ShareButton/ResultBox.tsx +0 -0
  137. /package/src/{components → ProfileView/components}/ViewSelector/Dropdown.tsx +0 -0
  138. /package/src/{components → ProfileView/components}/ViewSelector/index.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.16.451](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.450...@parca/profile@0.16.451) (2024-11-28)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.16.450](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.449...@parca/profile@0.16.450) (2024-11-28)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -14,7 +14,7 @@ import { QueryRequest_ReportType } from '@parca/client';
14
14
  import { useParcaContext, useURLState } from '@parca/components';
15
15
  import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_START_LINE, FIELD_FUNCTION_SYSTEM_NAME, FIELD_INLINED, FIELD_LOCATION_ADDRESS, FIELD_LOCATION_LINE, FIELD_MAPPING_BUILD_ID, FIELD_MAPPING_FILE, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
16
16
  import { arrowToString } from '../../ProfileIcicleGraph/IcicleGraphArrow/utils';
17
- import { useProfileViewContext } from '../../ProfileView/ProfileViewContext';
17
+ import { useProfileViewContext } from '../../ProfileView/context/ProfileViewContext';
18
18
  import { useQuery } from '../../useQuery';
19
19
  export const useGraphTooltipMetaInfo = ({ table, row }) => {
20
20
  const mappingFile = arrowToString(table.getChild(FIELD_MAPPING_FILE)?.get(row));
@@ -16,7 +16,7 @@ import { useURLState } from '@parca/components';
16
16
  import { setHoveringNode, useAppDispatch } from '@parca/store';
17
17
  import { scaleLinear, selectQueryParam } from '@parca/utilities';
18
18
  import GraphTooltip from '../../GraphTooltip';
19
- import { useProfileViewContext } from '../../ProfileView/ProfileViewContext';
19
+ import { useProfileViewContext } from '../../ProfileView/context/ProfileViewContext';
20
20
  import ColorStackLegend from './ColorStackLegend';
21
21
  import { IcicleNode, RowHeight } from './IcicleGraphNodes';
22
22
  import useColoredGraph from './useColoredGraph';
@@ -21,7 +21,7 @@ import { getLastItem, scaleLinear } from '@parca/utilities';
21
21
  import GraphTooltipArrow from '../../GraphTooltipArrow';
22
22
  import GraphTooltipArrowContent from '../../GraphTooltipArrow/Content';
23
23
  import { DockedGraphTooltip } from '../../GraphTooltipArrow/DockedGraphTooltip';
24
- import { useProfileViewContext } from '../../ProfileView/ProfileViewContext';
24
+ import { useProfileViewContext } from '../../ProfileView/context/ProfileViewContext';
25
25
  import ContextMenu from './ContextMenu';
26
26
  import { IcicleNode, RowHeight } from './IcicleGraphNodes';
27
27
  import { useFilenamesList } from './useMappingList';
@@ -15,8 +15,8 @@ import { useEffect, useMemo, useState } from 'react';
15
15
  import { AnimatePresence, motion } from 'framer-motion';
16
16
  import { IcicleGraphSkeleton, useParcaContext, useURLState } from '@parca/components';
17
17
  import { capitalizeOnlyFirstLetter, divide } from '@parca/utilities';
18
- import { useProfileViewContext } from '../ProfileView/ProfileViewContext';
19
- import DiffLegend from '../components/DiffLegend';
18
+ import DiffLegend from '../ProfileView/components/DiffLegend';
19
+ import { useProfileViewContext } from '../ProfileView/context/ProfileViewContext';
20
20
  import { IcicleGraph } from './IcicleGraph';
21
21
  import { FIELD_FUNCTION_NAME, IcicleGraphArrow } from './IcicleGraphArrow';
22
22
  import useMappingList from './IcicleGraphArrow/useMappingList';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupByDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ActionButtons/GroupByDropdown.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAoQzD,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC9C;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoDnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -16,7 +16,7 @@ import { Transition } from '@headlessui/react';
16
16
  import { Icon } from '@iconify/react';
17
17
  import Select from 'react-select';
18
18
  import { Button } from '@parca/components';
19
- import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_NAME, FIELD_LABELS, FIELD_LOCATION_ADDRESS, FIELD_MAPPING_FILE, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
19
+ import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_NAME, FIELD_LABELS, FIELD_LOCATION_ADDRESS, FIELD_MAPPING_FILE, } from '../../../ProfileIcicleGraph/IcicleGraphArrow';
20
20
  const groupByOptions = [
21
21
  {
22
22
  value: FIELD_FUNCTION_NAME,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortByDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ActionButtons/SortByDropdown.tsx"],"names":[],"mappings":"AAsBA,QAAA,MAAM,cAAc,QAAO,KAAK,CAAC,GAAG,CAAC,OA2DpC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -12,8 +12,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
  import { Select, useURLState } from '@parca/components';
15
- import { FIELD_CUMULATIVE, FIELD_DIFF, FIELD_FUNCTION_NAME, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
16
- import { useProfileViewContext } from '../../ProfileView/ProfileViewContext';
15
+ import { FIELD_CUMULATIVE, FIELD_DIFF, FIELD_FUNCTION_NAME, } from '../../../ProfileIcicleGraph/IcicleGraphArrow';
16
+ import { useProfileViewContext } from '../../context/ProfileViewContext';
17
17
  const SortByDropdown = () => {
18
18
  const [storeSortBy, setStoreSortBy] = useURLState('sort_by', {
19
19
  defaultValue: FIELD_FUNCTION_NAME,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorStackLegend.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/components/ColorStackLegend.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAYrC,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,gBAAgB,uCAA8C,KAAK,KAAG,KAAK,CAAC,GAAG,CAAC,OAmGrF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -17,8 +17,8 @@ import cx from 'classnames';
17
17
  import { useURLState } from '@parca/components';
18
18
  import { USER_PREFERENCES, useCurrentColorProfile, useUserPreference } from '@parca/hooks';
19
19
  import { EVERYTHING_ELSE, selectDarkMode, useAppSelector } from '@parca/store';
20
- import { getMappingColors } from '../ProfileIcicleGraph/IcicleGraphArrow/';
21
- import useMappingList from '../ProfileIcicleGraph/IcicleGraphArrow/useMappingList';
20
+ import { getMappingColors } from '../../ProfileIcicleGraph/IcicleGraphArrow';
21
+ import useMappingList from '../../ProfileIcicleGraph/IcicleGraphArrow/useMappingList';
22
22
  const ColorStackLegend = ({ mappings, compareMode = false, loading }) => {
23
23
  const isDarkMode = useAppSelector(selectDarkMode);
24
24
  const currentColorProfile = useCurrentColorProfile();
@@ -0,0 +1,26 @@
1
+ import { ProfilerOnRenderCallback } from 'react';
2
+ import { ProfileSource } from '../../../ProfileSource';
3
+ import type { CallgraphData, FlamegraphData, SourceData, TopTableData, VisualizationType } from '../../types/visualization';
4
+ interface GetDashboardItemProps {
5
+ type: VisualizationType;
6
+ isHalfScreen: boolean;
7
+ dimensions: DOMRect | undefined;
8
+ flamegraphData: FlamegraphData;
9
+ topTableData?: TopTableData;
10
+ callgraphData?: CallgraphData;
11
+ sourceData?: SourceData;
12
+ profileSource?: ProfileSource;
13
+ total: bigint;
14
+ filtered: bigint;
15
+ curPath: string[];
16
+ setNewCurPath: (path: string[]) => void;
17
+ currentSearchString?: string;
18
+ setSearchString?: (value: string) => void;
19
+ callgraphSVG?: string;
20
+ perf?: {
21
+ onRender?: ProfilerOnRenderCallback;
22
+ };
23
+ }
24
+ export declare const getDashboardItem: ({ type, isHalfScreen, dimensions, flamegraphData, topTableData, callgraphData, sourceData, profileSource, total, filtered, curPath, setNewCurPath, currentSearchString, setSearchString, callgraphSVG, perf, }: GetDashboardItemProps) => JSX.Element;
25
+ export {};
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/DashboardItems/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAW,wBAAwB,EAAC,MAAM,OAAO,CAAC;AAMzD,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAGrD,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,YAAY,EACZ,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,UAAU,qBAAqB;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE,wBAAwB,CAAC;KACrC,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,mNAiB1B,qBAAqB,KAAG,GAAG,CAAC,OA+E9B,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } 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 { Profiler } from 'react';
15
+ import { ConditionalWrapper } from '@parca/components';
16
+ import Callgraph from '../../../Callgraph';
17
+ import ProfileIcicleGraph from '../../../ProfileIcicleGraph';
18
+ import { SourceView } from '../../../SourceView';
19
+ import { Table } from '../../../Table';
20
+ export const getDashboardItem = ({ type, isHalfScreen, dimensions, flamegraphData, topTableData, callgraphData, sourceData, profileSource, total, filtered, curPath, setNewCurPath, currentSearchString, setSearchString, callgraphSVG, perf, }) => {
21
+ switch (type) {
22
+ case 'icicle':
23
+ return (_jsx(ConditionalWrapper, { condition: perf?.onRender != null, WrapperComponent: Profiler, wrapperProps: {
24
+ id: 'icicleGraph',
25
+ onRender: perf?.onRender ?? (() => { }),
26
+ }, children: _jsx(ProfileIcicleGraph, { curPath: curPath, setNewCurPath: setNewCurPath, arrow: flamegraphData?.arrow, graph: flamegraphData?.data, total: total, filtered: filtered, profileType: profileSource?.ProfileType(), loading: flamegraphData.loading, error: flamegraphData.error, isHalfScreen: isHalfScreen, width: dimensions?.width !== undefined
27
+ ? isHalfScreen
28
+ ? (dimensions.width - 54) / 2
29
+ : dimensions.width - 16
30
+ : 0, metadataMappingFiles: flamegraphData.metadataMappingFiles, metadataLoading: flamegraphData.metadataLoading }) }));
31
+ case 'callgraph':
32
+ return callgraphData?.data !== undefined &&
33
+ callgraphSVG !== undefined &&
34
+ dimensions?.width !== undefined ? (_jsx(Callgraph, { data: callgraphData.data, svgString: callgraphSVG, profileType: profileSource?.ProfileType(), width: isHalfScreen ? dimensions?.width / 2 : dimensions?.width })) : (_jsx(_Fragment, {}));
35
+ case 'table':
36
+ return topTableData != null ? (_jsx(Table, { total: total, filtered: filtered, loading: topTableData.loading, data: topTableData.arrow?.record, unit: topTableData.unit, profileType: profileSource?.ProfileType(), currentSearchString: currentSearchString, setSearchString: setSearchString, isHalfScreen: isHalfScreen, metadataMappingFiles: flamegraphData.metadataMappingFiles })) : (_jsx(_Fragment, {}));
37
+ case 'source':
38
+ return sourceData != null ? (_jsx(SourceView, { loading: sourceData.loading, data: sourceData.data, total: total, filtered: filtered })) : (_jsx(_Fragment, {}));
39
+ default:
40
+ return _jsx(_Fragment, {});
41
+ }
42
+ };
@@ -0,0 +1,15 @@
1
+ import { FC } from 'react';
2
+ import { VisualizationType } from '../../types/visualization';
3
+ interface DashboardLayoutProps {
4
+ getDashboardItemByType: (props: {
5
+ type: VisualizationType;
6
+ isHalfScreen: boolean;
7
+ }) => JSX.Element;
8
+ actionButtons: {
9
+ icicle: JSX.Element;
10
+ table: JSX.Element;
11
+ };
12
+ }
13
+ export declare const DashboardLayout: FC<DashboardLayoutProps>;
14
+ export {};
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/DashboardLayout/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAYzB,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAG5D,UAAU,oBAAoB;IAC5B,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAC,IAAI,EAAE,iBAAiB,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAC,KAAK,GAAG,CAAC,OAAO,CAAC;IACjG,aAAa,EAAE;QACb,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;QACpB,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;KACpB,CAAC;CACH;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA2DpD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import cx from 'classnames';
3
+ import { DragDropContext, Draggable, Droppable, } from 'react-beautiful-dnd';
4
+ import { useDashboard } from '../../context/DashboardContext';
5
+ import { VisualizationContainer } from '../VisualizationContainer';
6
+ export const DashboardLayout = ({ getDashboardItemByType, actionButtons, }) => {
7
+ const { dashboardItems, setDashboardItems, isMultiPanelView } = useDashboard();
8
+ const onDragEnd = (result) => {
9
+ const { destination, source, draggableId } = result;
10
+ if (Boolean(destination) && destination?.index !== source.index) {
11
+ const targetItem = draggableId;
12
+ const otherItems = dashboardItems.filter(item => item !== targetItem);
13
+ const newDashboardItems = destination.index < source.index
14
+ ? [targetItem, ...otherItems]
15
+ : [...otherItems, targetItem];
16
+ setDashboardItems(newDashboardItems);
17
+ }
18
+ };
19
+ return (_jsx(DragDropContext, { onDragEnd: onDragEnd, children: _jsx(Droppable, { droppableId: "droppable", direction: "horizontal", children: provided => (_jsxs("div", { ref: provided.innerRef, className: cx('grid w-full gap-2', isMultiPanelView ? 'grid-cols-2 mt-4' : 'grid-cols-1'), ...provided.droppableProps, children: [dashboardItems.map((dashboardItem, index) => (_jsx(Draggable, { draggableId: dashboardItem, index: index, isDragDisabled: !isMultiPanelView, children: (provided, snapshot) => (_jsx(VisualizationContainer, { provided: provided, snapshot: snapshot, dashboardItem: dashboardItem, getDashboardItemByType: getDashboardItemByType, isMultiPanelView: isMultiPanelView, index: index, actionButtons: actionButtons })) }, dashboardItem))), provided.placeholder] })) }) }));
20
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiffLegend.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/components/DiffLegend.tsx"],"names":[],"mappings":"AA0DA,QAAA,MAAM,UAAU,QAAO,GAAG,CAAC,OAqD1B,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterByFunctionButton.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/components/FilterByFunctionButton.tsx"],"names":[],"mappings":"AAoBA,QAAA,MAAM,sBAAsB,QAAO,GAAG,CAAC,OAuCtC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ interface ProfileHeaderProps {
3
+ profileSourceString?: string;
4
+ hasProfileSource: boolean;
5
+ externalMainActions?: React.ReactNode;
6
+ }
7
+ export declare const ProfileHeader: FC<ProfileHeaderProps>;
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ProfileHeader/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAIzB,UAAU,kBAAkB;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACvC;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA4ChD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import cx from 'classnames';
3
+ export const ProfileHeader = ({ profileSourceString, hasProfileSource, externalMainActions, }) => {
4
+ const headerParts = profileSourceString?.split('"') ?? [];
5
+ const showDivider = hasProfileSource && (externalMainActions === null || externalMainActions === undefined);
6
+ return (_jsxs(_Fragment, { children: [showDivider && (_jsx("div", { className: "border-t border-gray-200 dark:border-gray-700 h-[1px] w-full pb-4" })), _jsx("div", { className: cx('flex w-full', hasProfileSource || externalMainActions != null ? 'justify-start' : 'justify-end', {
7
+ 'items-end mb-4': !hasProfileSource && externalMainActions != null,
8
+ 'items-center mb-2': hasProfileSource,
9
+ }), children: _jsxs("div", { children: [hasProfileSource && (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("div", { className: "text-xs font-medium", children: headerParts.length > 0 ? headerParts[0].replace(/"/g, '') : '' }), _jsx("div", { className: "text-xs font-medium", children: headerParts.length > 1
10
+ ? headerParts[headerParts.length - 1].replace(/"/g, '')
11
+ : '' })] })), externalMainActions] }) })] }));
12
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultBox.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ShareButton/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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { QueryRequest, QueryServiceClient } from '@parca/client';
3
- import { ProfileSource } from '../../ProfileSource';
3
+ import { ProfileSource } from '../../../ProfileSource';
4
4
  interface Props {
5
5
  profileSource?: ProfileSource;
6
6
  queryClient?: QueryServiceClient;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ShareButton/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAItC,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAG/D,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAGrD,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,6BAA6B,EAAE,KAAK,CAAC,SAAS,CAAC;CAChD;AAkGD,QAAA,MAAM,WAAW,oHAOd,KAAK,KAAG,GAAG,CAAC,OA4Ed,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiLevelDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AA6H1C,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAsJzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -16,8 +16,8 @@ import { Menu } from '@headlessui/react';
16
16
  import { Icon } from '@iconify/react';
17
17
  import { useURLState } from '@parca/components';
18
18
  import { USER_PREFERENCES, useUserPreference } from '@parca/hooks';
19
- import { FIELD_FUNCTION_NAME, } from '../../ProfileIcicleGraph/IcicleGraphArrow';
20
- import { useProfileViewContext } from '../../ProfileView/ProfileViewContext';
19
+ import { FIELD_FUNCTION_NAME } from '../../../ProfileIcicleGraph/IcicleGraphArrow';
20
+ import { useProfileViewContext } from '../../context/ProfileViewContext';
21
21
  const MenuItem = ({ label, items, onclick, onSelect, path = [], id, closeDropdown, isNested = false, activeValueForSortBy, activeValueForColorBy, value, disabled = false, icon, customSubmenu, }) => {
22
22
  let isActive = false;
23
23
  if (isNested) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableColumnsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAQ1C,UAAU,KAAK;IACb,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,oBAAoB,qCAAoC,KAAK,KAAG,GAAG,CAAC,OA6LzE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -15,10 +15,10 @@ import { useEffect, useMemo, useState } from 'react';
15
15
  import { createColumnHelper } from '@tanstack/table-core';
16
16
  import { useURLState } from '@parca/components';
17
17
  import { valueFormatter } from '@parca/utilities';
18
- import { useProfileViewContext } from '../../ProfileView/ProfileViewContext';
19
- import { isDummyRow } from '../../Table';
20
- import ColumnsVisibility from '../../Table/ColumnsVisibility';
21
- import { addPlusSign, getRatioString } from '../../Table/utils/functions';
18
+ import { isDummyRow } from '../../../Table';
19
+ import ColumnsVisibility from '../../../Table/ColumnsVisibility';
20
+ import { addPlusSign, getRatioString } from '../../../Table/utils/functions';
21
+ import { useProfileViewContext } from '../../context/ProfileViewContext';
22
22
  const TableColumnsDropdown = ({ profileType, total, filtered }) => {
23
23
  const { compareMode } = useProfileViewContext();
24
24
  const [tableColumns, setTableColumns] = useURLState('table_columns', {
@@ -0,0 +1,41 @@
1
+ import { FC } from 'react';
2
+ import { QueryServiceClient } from '@parca/client';
3
+ import { ProfileType } from '@parca/parser';
4
+ import { ProfileSource } from '../../../ProfileSource';
5
+ export interface VisualisationToolbarProps {
6
+ groupBy: string[];
7
+ toggleGroupBy: (key: string) => void;
8
+ hasProfileSource: boolean;
9
+ pprofdownloading?: boolean;
10
+ profileSource?: ProfileSource;
11
+ queryClient?: QueryServiceClient;
12
+ onDownloadPProf: () => void;
13
+ curPath: string[];
14
+ setNewCurPath: (path: string[]) => void;
15
+ profileType?: ProfileType;
16
+ total: bigint;
17
+ filtered: bigint;
18
+ currentSearchString?: string;
19
+ setSearchString?: (value: string) => void;
20
+ groupByLabels: string[];
21
+ preferencesModal?: boolean;
22
+ profileViewExternalSubActions?: React.ReactNode;
23
+ clearSelection: () => void;
24
+ setGroupByLabels: (labels: string[]) => void;
25
+ showVisualizationSelector?: boolean;
26
+ }
27
+ export interface TableToolbarProps {
28
+ profileType?: ProfileType;
29
+ total: bigint;
30
+ filtered: bigint;
31
+ clearSelection: () => void;
32
+ currentSearchString?: string;
33
+ }
34
+ export interface IcicleGraphToolbarProps {
35
+ curPath: string[];
36
+ setNewCurPath: (path: string[]) => void;
37
+ }
38
+ export declare const TableToolbar: FC<TableToolbarProps>;
39
+ export declare const IcicleGraphToolbar: FC<IcicleGraphToolbarProps>;
40
+ export declare const VisualisationToolbar: FC<VisualisationToolbarProps>;
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAIzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAUrD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6BAA6B,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAuB9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAiB1D,CAAC;AAMF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA6E9D,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Icon } from '@iconify/react';
3
+ import { Button, UserPreferencesModal } from '@parca/components';
4
+ import { useDashboard } from '../../context/DashboardContext';
5
+ import GroupByDropdown from '../ActionButtons/GroupByDropdown';
6
+ import SortByDropdown from '../ActionButtons/SortByDropdown';
7
+ import FilterByFunctionButton from '../FilterByFunctionButton';
8
+ import ShareButton from '../ShareButton';
9
+ import ViewSelector from '../ViewSelector';
10
+ import MultiLevelDropdown from './MultiLevelDropdown';
11
+ import TableColumnsDropdown from './TableColumnsDropdown';
12
+ export const TableToolbar = ({ profileType, total, filtered, clearSelection, currentSearchString, }) => {
13
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: "flex w-full gap-2 items-end", children: [_jsx(TableColumnsDropdown, { profileType: profileType, total: total, filtered: filtered }), _jsx(Button, { color: "neutral", onClick: clearSelection, className: "w-auto", variant: "neutral", disabled: currentSearchString === undefined || currentSearchString.length === 0, children: "Clear selection" })] }) }));
14
+ };
15
+ export const IcicleGraphToolbar = ({ curPath, setNewCurPath }) => {
16
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: "flex w-full gap-2 items-end", children: [_jsx(SortByDropdown, {}), _jsxs(Button, { variant: "neutral", className: "gap-2 w-max h-fit", onClick: () => setNewCurPath([]), disabled: curPath.length === 0, children: ["Reset graph", _jsx(Icon, { icon: "system-uicons:reset", width: 20 })] })] }) }));
17
+ };
18
+ const Divider = () => (_jsx("div", { className: "border-t mt-4 border-gray-200 dark:border-gray-700 h-[1px] w-full pb-4" }));
19
+ export const VisualisationToolbar = ({ groupBy, toggleGroupBy, groupByLabels, setGroupByLabels, profileType, preferencesModal, profileSource, queryClient, onDownloadPProf, pprofdownloading, profileViewExternalSubActions, curPath, setNewCurPath, total, filtered, currentSearchString, clearSelection, showVisualizationSelector = true, }) => {
20
+ const { dashboardItems } = useDashboard();
21
+ const isTableViz = dashboardItems?.includes('table');
22
+ const isGraphViz = dashboardItems?.includes('icicle');
23
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full justify-between items-end", children: [_jsxs("div", { className: "flex gap-3 items-end", children: [_jsxs(_Fragment, { children: [_jsx(GroupByDropdown, { groupBy: groupBy, toggleGroupBy: toggleGroupBy, labels: groupByLabels, setGroupByLabels: setGroupByLabels }), _jsx(MultiLevelDropdown, { profileType: profileType, onSelect: () => { } })] }), _jsx(FilterByFunctionButton, {}), profileViewExternalSubActions != null ? profileViewExternalSubActions : null] }), _jsxs("div", { className: "flex gap-3", children: [preferencesModal != null ? _jsx(UserPreferencesModal, {}) : null, _jsx(ShareButton, { profileSource: profileSource, queryClient: queryClient, queryRequest: profileSource?.QueryRequest() ?? undefined, onDownloadPProf: onDownloadPProf, pprofdownloading: pprofdownloading ?? false, profileViewExternalSubActions: profileViewExternalSubActions }), showVisualizationSelector ? _jsx(ViewSelector, {}) : null] })] }), isGraphViz && !isTableViz && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(IcicleGraphToolbar, { curPath: curPath, setNewCurPath: setNewCurPath })] })), isTableViz && !isGraphViz && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(TableToolbar, { profileType: profileType, total: total, filtered: filtered, clearSelection: clearSelection, currentSearchString: currentSearchString })] }))] }));
24
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/Dropdown.tsx"],"names":[],"mappings":"AAqBA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAMnE;AAED,QAAA,MAAM,QAAQ,8GAYX;IACD,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,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,KAAG,GAAG,CAAC,OA4GP,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/index.tsx"],"names":[],"mappings":"AAiBA,QAAA,MAAM,YAAY,QAAO,GAAG,CAAC,OAwF5B,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { FC } from 'react';
2
+ import type { DraggableProvided, DraggableStateSnapshot } from 'react-beautiful-dnd';
3
+ import { VisualizationType } from '../../types/visualization';
4
+ interface VisualizationContainerProps {
5
+ provided: DraggableProvided;
6
+ snapshot: DraggableStateSnapshot;
7
+ dashboardItem: VisualizationType;
8
+ getDashboardItemByType: (props: {
9
+ type: VisualizationType;
10
+ isHalfScreen: boolean;
11
+ }) => JSX.Element;
12
+ isMultiPanelView: boolean;
13
+ index: number;
14
+ actionButtons: {
15
+ icicle: JSX.Element;
16
+ table: JSX.Element;
17
+ };
18
+ }
19
+ export declare const VisualizationContainer: FC<VisualizationContainerProps>;
20
+ export {};
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/VisualizationContainer/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAGzB,OAAO,KAAK,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAGnF,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAG5D,UAAU,2BAA2B;IACnC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,aAAa,EAAE,iBAAiB,CAAC;IACjC,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAC,IAAI,EAAE,iBAAiB,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAC,KAAK,GAAG,CAAC,OAAO,CAAC;IACjG,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE;QACb,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;QACpB,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;KACpB,CAAC;CACH;AAED,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,2BAA2B,CAgClE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import cx from 'classnames';
3
+ import { useDashboard } from '../../context/DashboardContext';
4
+ import { VisualizationPanel } from '../VisualizationPanel';
5
+ export const VisualizationContainer = ({ provided, snapshot, dashboardItem, getDashboardItemByType, isMultiPanelView, index, actionButtons, }) => {
6
+ const { handleClosePanel } = useDashboard();
7
+ return (_jsx("div", { ref: provided.innerRef, ...provided.draggableProps, className: cx('w-full min-h-96', snapshot.isDragging ? 'bg-gray-200 dark:bg-gray-500' : 'bg-white dark:bg-gray-900', isMultiPanelView ? 'border-2 border-gray-100 dark:border-gray-700 rounded-md p-3' : ''), children: _jsx(VisualizationPanel, { handleClosePanel: handleClosePanel, isMultiPanelView: isMultiPanelView, dashboardItem: dashboardItem, getDashboardItemByType: getDashboardItemByType, dragHandleProps: provided.dragHandleProps, index: index, actionButtons: actionButtons }) }));
8
+ };
@@ -1,13 +1,14 @@
1
1
  import React from 'react';
2
2
  import type { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';
3
+ import { VisualizationType } from '../types/visualization';
3
4
  interface Props {
4
- dashboardItem: string;
5
+ dashboardItem: VisualizationType;
5
6
  index: number;
6
7
  isMultiPanelView: boolean;
7
- handleClosePanel: (dashboardItem: string) => void;
8
+ handleClosePanel: (dashboardItem: VisualizationType) => void;
8
9
  dragHandleProps: DraggableProvidedDragHandleProps | null | undefined;
9
10
  getDashboardItemByType: (props: {
10
- type: string;
11
+ type: VisualizationType;
11
12
  isHalfScreen: boolean;
12
13
  }) => JSX.Element;
13
14
  actionButtons: {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisualizationPanel.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/components/VisualizationPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAC,gCAAgC,EAAC,MAAM,qBAAqB,CAAC;AAK1E,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD,UAAU,KAAK;IACb,aAAa,EAAE,iBAAiB,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,CAAC,aAAa,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7D,eAAe,EAAE,gCAAgC,GAAG,IAAI,GAAG,SAAS,CAAC;IACrE,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAC,IAAI,EAAE,iBAAiB,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAC,KAAK,GAAG,CAAC,OAAO,CAAC;IACjG,aAAa,EAAE;QACb,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;QACpB,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;KACpB,CAAC;CACH;AAED,eAAO,MAAM,kBAAkB,mCAyD7B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { VisualizationType } from '../types/visualization';
3
+ interface DashboardContextType {
4
+ dashboardItems: string[];
5
+ setDashboardItems: (items: string[]) => void;
6
+ handleClosePanel: (visualizationType: VisualizationType) => void;
7
+ isMultiPanelView: boolean;
8
+ }
9
+ export declare const DashboardProvider: FC<PropsWithChildren>;
10
+ export declare const useDashboard: () => DashboardContextType;
11
+ export {};
12
+ //# sourceMappingURL=DashboardContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardContext.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/context/DashboardContext.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AAIvE,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD,UAAU,oBAAoB;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAID,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAwBnD,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,oBAM/B,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx } 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 { createContext, useContext } from 'react';
15
+ import { useURLState } from '@parca/components';
16
+ const DashboardContext = createContext(undefined);
17
+ export const DashboardProvider = ({ children }) => {
18
+ const [dashboardItems, setDashboardItems] = useURLState('dashboard_items', {
19
+ alwaysReturnArray: true,
20
+ });
21
+ const handleClosePanel = (visualizationType) => {
22
+ const newDashboardItems = dashboardItems.filter(item => item !== visualizationType);
23
+ setDashboardItems(newDashboardItems);
24
+ };
25
+ const isMultiPanelView = dashboardItems.length > 1;
26
+ return (_jsx(DashboardContext.Provider, { value: {
27
+ dashboardItems,
28
+ setDashboardItems,
29
+ handleClosePanel,
30
+ isMultiPanelView,
31
+ }, children: children }));
32
+ };
33
+ export const useDashboard = () => {
34
+ const context = useContext(DashboardContext);
35
+ if (context === undefined) {
36
+ throw new Error('useDashboard must be used within a DashboardProvider');
37
+ }
38
+ return context;
39
+ };
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ProfileSource } from '../ProfileSource';
2
+ import { ProfileSource } from '../../ProfileSource';
3
3
  interface Props {
4
4
  profileSource?: ProfileSource;
5
5
  compareMode: boolean;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProfileViewContext.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/context/ProfileViewContext.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,SAAS,EAA4B,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAElD,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,EAAE,KAG1B,CAAC;AAEF,QAAA,MAAM,kBAAkB,gCAAqC,CAAC;AAE9D,eAAO,MAAM,0BAA0B,yBAGpC;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,KAAG,GAAG,CAAC,OAMP,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,KAMxC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Callgraph as CallgraphType } from '@parca/client';
2
+ interface UseGraphvizProps {
3
+ callgraphData?: CallgraphType;
4
+ width?: number;
5
+ colorRange: [string, string];
6
+ }
7
+ export declare const useGraphviz: ({ callgraphData, width, colorRange, }: UseGraphvizProps) => {
8
+ graphvizLoaded: boolean;
9
+ callgraphSVG: string | undefined;
10
+ };
11
+ export {};
12
+ //# sourceMappingURL=useGraphviz.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGraphviz.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useGraphviz.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,eAAe,CAAC;AAIzD,UAAU,gBAAgB;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,eAAO,MAAM,WAAW,0CAIrB,gBAAgB,KAAG;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAmClC,CAAC"}
@@ -0,0 +1,42 @@
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
+ import { useEffect, useState } from 'react';
14
+ import graphviz from 'graphviz-wasm';
15
+ import { jsonToDot } from '../../Callgraph/utils';
16
+ export const useGraphviz = ({ callgraphData, width, colorRange, }) => {
17
+ const [graphvizLoaded, setGraphvizLoaded] = useState(false);
18
+ const [callgraphSVG, setCallgraphSVG] = useState(undefined);
19
+ useEffect(() => {
20
+ async function loadGraphviz() {
21
+ await graphviz.loadWASM();
22
+ setGraphvizLoaded(true);
23
+ }
24
+ void loadGraphviz();
25
+ }, []);
26
+ useEffect(() => {
27
+ async function loadCallgraphSVG(graph, width, colorRange) {
28
+ await setCallgraphSVG(undefined);
29
+ const dataAsDot = await jsonToDot({
30
+ graph,
31
+ width,
32
+ colorRange,
33
+ });
34
+ const svgGraph = await graphviz.layout(dataAsDot, 'svg', 'dot');
35
+ await setCallgraphSVG(svgGraph);
36
+ }
37
+ if (graphvizLoaded && callgraphData != null && width != null) {
38
+ void loadCallgraphSVG(callgraphData, width, colorRange);
39
+ }
40
+ }, [graphvizLoaded, callgraphData, width, colorRange]);
41
+ return { graphvizLoaded, callgraphSVG };
42
+ };