@parca/profile 0.19.126 → 0.19.127
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/MetricsGraph/useMetricsGraphDimensions.d.ts +1 -1
- package/dist/MetricsGraph/useMetricsGraphDimensions.d.ts.map +1 -1
- package/dist/MetricsGraph/useMetricsGraphDimensions.js +5 -10
- package/dist/ProfileMetricsGraph/index.js +2 -3
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +3 -3
- package/package.json +3 -3
- package/src/MetricsGraph/useMetricsGraphDimensions.ts +7 -12
- package/src/ProfileMetricsGraph/index.tsx +3 -3
- package/src/ProfileSelector/MetricsGraphSection.tsx +3 -3
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.19.127](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.126...@parca/profile@0.19.127) (2026-02-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
6
10
|
## [0.19.126](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.125...@parca/profile@0.19.126) (2026-02-23)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -4,6 +4,6 @@ interface MetricsGraphDimensions {
|
|
|
4
4
|
heightStyle: string;
|
|
5
5
|
margin: number;
|
|
6
6
|
}
|
|
7
|
-
export declare const useMetricsGraphDimensions: (comparing: boolean,
|
|
7
|
+
export declare const useMetricsGraphDimensions: (comparing: boolean, maxHeight?: number) => MetricsGraphDimensions;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=useMetricsGraphDimensions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMetricsGraphDimensions.d.ts","sourceRoot":"","sources":["../../src/MetricsGraph/useMetricsGraphDimensions.ts"],"names":[],"mappings":"AAiBA,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"useMetricsGraphDimensions.d.ts","sourceRoot":"","sources":["../../src/MetricsGraph/useMetricsGraphDimensions.ts"],"names":[],"mappings":"AAiBA,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,eAAO,MAAM,yBAAyB,GACpC,WAAW,OAAO,EAClB,kBAAe,KACd,sBA2BF,CAAC"}
|
|
@@ -12,11 +12,8 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { useWindowSize } from 'react-use';
|
|
14
14
|
import { useParcaContext } from '@parca/components';
|
|
15
|
-
const MAX_HEIGHT = 402;
|
|
16
|
-
const MINI_VARIANT_HEIGHT = 180;
|
|
17
15
|
const margin = 50;
|
|
18
|
-
export const useMetricsGraphDimensions = (comparing,
|
|
19
|
-
const maxHeight = isMini ? MINI_VARIANT_HEIGHT : MAX_HEIGHT;
|
|
16
|
+
export const useMetricsGraphDimensions = (comparing, maxHeight = 402) => {
|
|
20
17
|
let { width } = useWindowSize();
|
|
21
18
|
const { profileExplorer } = useParcaContext();
|
|
22
19
|
if (profileExplorer == null) {
|
|
@@ -31,12 +28,10 @@ export const useMetricsGraphDimensions = (comparing, isMini = false) => {
|
|
|
31
28
|
if (comparing) {
|
|
32
29
|
width = width / 2 - 32;
|
|
33
30
|
}
|
|
34
|
-
const height =
|
|
35
|
-
const heightStyle =
|
|
36
|
-
?
|
|
37
|
-
:
|
|
38
|
-
? profileExplorer.metricsGraph.maxHeightStyle.compareMode
|
|
39
|
-
: profileExplorer.metricsGraph.maxHeightStyle.default})`;
|
|
31
|
+
const height = Math.min(width / 2.5, maxHeight);
|
|
32
|
+
const heightStyle = `min(${maxHeight + margin}px, ${comparing
|
|
33
|
+
? profileExplorer.metricsGraph.maxHeightStyle.compareMode
|
|
34
|
+
: profileExplorer.metricsGraph.maxHeightStyle.default})`;
|
|
40
35
|
return {
|
|
41
36
|
width,
|
|
42
37
|
height,
|
|
@@ -124,9 +124,8 @@ const ProfileMetricsGraph = ({ queryClient, queryExpression, profile, from, to,
|
|
|
124
124
|
return Math.min(rawStepCount, maxForOneSecond);
|
|
125
125
|
}, [rawStepCount, from, to]);
|
|
126
126
|
const { isLoading: metricsGraphLoading, response, error, } = useQueryRange(queryClient, queryExpression, from, to, sumBy, stepCount, queryExpression === '');
|
|
127
|
-
const { onError, perf, authenticationErrorMessage, isDarkMode, timezone } = useParcaContext();
|
|
128
|
-
const
|
|
129
|
-
const { width, height, margin, heightStyle } = useMetricsGraphDimensions(comparing, isGpuProfileType);
|
|
127
|
+
const { onError, perf, authenticationErrorMessage, isDarkMode, timezone, profileExplorer } = useParcaContext();
|
|
128
|
+
const { width, height, margin, heightStyle } = useMetricsGraphDimensions(comparing, profileExplorer?.metricsGraph.height);
|
|
130
129
|
const [showAllSeriesForResponse, setShowAllSeriesForResponse] = useState(null);
|
|
131
130
|
useEffect(() => {
|
|
132
131
|
if (error !== null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsGraphSection.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/MetricsGraphSection.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAQ,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"MetricsGraphSection.d.ts","sourceRoot":"","sources":["../../src/ProfileSelector/MetricsGraphSection.tsx"],"names":[],"mappings":"AAeA,OAAO,E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OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,EAClC,gBAAgB,EAChB,gCAAgC,EAChC,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,KAAK,EACL,qBAAqB,EACrB,WAAW,EACX,mBAA2B,EAC3B,iBAAyB,GAC1B,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAmIxC"}
|
|
@@ -12,7 +12,7 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } 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 cx from 'classnames';
|
|
15
|
-
import { useURLStateBatch } from '@parca/components';
|
|
15
|
+
import { useParcaContext, useURLStateBatch } from '@parca/components';
|
|
16
16
|
import { Query } from '@parca/parser';
|
|
17
17
|
import { useMetricsGraphDimensions } from '../MetricsGraph/useMetricsGraphDimensions';
|
|
18
18
|
import ProfileMetricsGraph, { ProfileMetricsEmptyState } from '../ProfileMetricsGraph';
|
|
@@ -20,8 +20,8 @@ import { useResetStateOnSeriesChange } from '../ProfileView/hooks/useResetStateO
|
|
|
20
20
|
export function MetricsGraphSection({ showMetricsGraph, setDisplayHideMetricsGraphButton, querySelection, profileSelection, comparing, sumBy, defaultSumByLoading, queryClient, queryExpressionString, setTimeRangeSelection, selectQuery, setProfileSelection, query, setNewQueryExpression, commitDraft, profileTypesLoading = false, hasNoProfileTypes = false, }) {
|
|
21
21
|
const resetStateOnSeriesChange = useResetStateOnSeriesChange();
|
|
22
22
|
const batchUpdates = useURLStateBatch();
|
|
23
|
-
const
|
|
24
|
-
const { heightStyle } = useMetricsGraphDimensions(comparing,
|
|
23
|
+
const { profileExplorer } = useParcaContext();
|
|
24
|
+
const { heightStyle } = useMetricsGraphDimensions(comparing, profileExplorer?.metricsGraph.height);
|
|
25
25
|
const handleTimeRangeChange = (range) => {
|
|
26
26
|
const from = range.getFromMs();
|
|
27
27
|
const to = range.getToMs();
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.127",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@floating-ui/react": "^0.27.12",
|
|
7
7
|
"@headlessui/react": "^1.7.19",
|
|
8
8
|
"@iconify/react": "^4.0.0",
|
|
9
9
|
"@parca/client": "0.17.17",
|
|
10
|
-
"@parca/components": "0.16.
|
|
10
|
+
"@parca/components": "0.16.404",
|
|
11
11
|
"@parca/dynamicsize": "0.16.72",
|
|
12
12
|
"@parca/hooks": "0.0.118",
|
|
13
13
|
"@parca/icons": "0.16.79",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"access": "public",
|
|
89
89
|
"registry": "https://registry.npmjs.org/"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "344bd4f2b926f0eecfa47459ba9cc9f6f731ef7d"
|
|
92
92
|
}
|
|
@@ -22,15 +22,12 @@ interface MetricsGraphDimensions {
|
|
|
22
22
|
margin: number;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const MAX_HEIGHT = 402;
|
|
26
|
-
const MINI_VARIANT_HEIGHT = 180;
|
|
27
25
|
const margin = 50;
|
|
28
26
|
|
|
29
27
|
export const useMetricsGraphDimensions = (
|
|
30
28
|
comparing: boolean,
|
|
31
|
-
|
|
29
|
+
maxHeight = 402
|
|
32
30
|
): MetricsGraphDimensions => {
|
|
33
|
-
const maxHeight = isMini ? MINI_VARIANT_HEIGHT : MAX_HEIGHT;
|
|
34
31
|
let {width} = useWindowSize();
|
|
35
32
|
const {profileExplorer} = useParcaContext();
|
|
36
33
|
if (profileExplorer == null) {
|
|
@@ -45,14 +42,12 @@ export const useMetricsGraphDimensions = (
|
|
|
45
42
|
if (comparing) {
|
|
46
43
|
width = width / 2 - 32;
|
|
47
44
|
}
|
|
48
|
-
const height =
|
|
49
|
-
const heightStyle =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
: profileExplorer.metricsGraph.maxHeightStyle.default
|
|
55
|
-
})`;
|
|
45
|
+
const height = Math.min(width / 2.5, maxHeight);
|
|
46
|
+
const heightStyle = `min(${maxHeight + margin}px, ${
|
|
47
|
+
comparing
|
|
48
|
+
? profileExplorer.metricsGraph.maxHeightStyle.compareMode
|
|
49
|
+
: profileExplorer.metricsGraph.maxHeightStyle.default
|
|
50
|
+
})`;
|
|
56
51
|
return {
|
|
57
52
|
width,
|
|
58
53
|
height,
|
|
@@ -224,11 +224,11 @@ const ProfileMetricsGraph = ({
|
|
|
224
224
|
stepCount,
|
|
225
225
|
queryExpression === ''
|
|
226
226
|
);
|
|
227
|
-
const {onError, perf, authenticationErrorMessage, isDarkMode, timezone} =
|
|
228
|
-
|
|
227
|
+
const {onError, perf, authenticationErrorMessage, isDarkMode, timezone, profileExplorer} =
|
|
228
|
+
useParcaContext();
|
|
229
229
|
const {width, height, margin, heightStyle} = useMetricsGraphDimensions(
|
|
230
230
|
comparing,
|
|
231
|
-
|
|
231
|
+
profileExplorer?.metricsGraph.height
|
|
232
232
|
);
|
|
233
233
|
const [showAllSeriesForResponse, setShowAllSeriesForResponse] = useState<typeof response | null>(
|
|
234
234
|
null
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import cx from 'classnames';
|
|
15
15
|
|
|
16
16
|
import {Label, QueryServiceClient} from '@parca/client';
|
|
17
|
-
import {DateTimeRange, useURLStateBatch} from '@parca/components';
|
|
17
|
+
import {DateTimeRange, useParcaContext, useURLStateBatch} from '@parca/components';
|
|
18
18
|
import {Query} from '@parca/parser';
|
|
19
19
|
|
|
20
20
|
import {ProfileSelection} from '..';
|
|
@@ -68,8 +68,8 @@ export function MetricsGraphSection({
|
|
|
68
68
|
}: MetricsGraphSectionProps): JSX.Element {
|
|
69
69
|
const resetStateOnSeriesChange = useResetStateOnSeriesChange();
|
|
70
70
|
const batchUpdates = useURLStateBatch();
|
|
71
|
-
const
|
|
72
|
-
const {heightStyle} = useMetricsGraphDimensions(comparing,
|
|
71
|
+
const {profileExplorer} = useParcaContext();
|
|
72
|
+
const {heightStyle} = useMetricsGraphDimensions(comparing, profileExplorer?.metricsGraph.height);
|
|
73
73
|
const handleTimeRangeChange = (range: DateTimeRange): void => {
|
|
74
74
|
const from = range.getFromMs();
|
|
75
75
|
const to = range.getToMs();
|