@parca/profile 0.16.443 → 0.16.445
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 +8 -0
- package/dist/MetricsGraphStrips/AreaGraph/index.d.ts +20 -0
- package/dist/MetricsGraphStrips/AreaGraph/index.d.ts.map +1 -0
- package/dist/MetricsGraphStrips/AreaGraph/index.js +166 -0
- package/dist/MetricsGraphStrips/MetricsGraphStrips.stories.d.ts +17 -0
- package/dist/MetricsGraphStrips/MetricsGraphStrips.stories.d.ts.map +1 -0
- package/dist/MetricsGraphStrips/MetricsGraphStrips.stories.js +48 -0
- package/dist/MetricsGraphStrips/TimelineGuide/index.d.ts +10 -0
- package/dist/MetricsGraphStrips/TimelineGuide/index.d.ts.map +1 -0
- package/dist/MetricsGraphStrips/TimelineGuide/index.js +40 -0
- package/dist/MetricsGraphStrips/index.d.ts +13 -0
- package/dist/MetricsGraphStrips/index.d.ts.map +1 -0
- package/dist/MetricsGraphStrips/index.js +41 -0
- package/dist/ProfileIcicleGraph/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/index.js +3 -11
- package/dist/ProfileView/ColorStackLegend.d.ts.map +1 -0
- package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileView}/ColorStackLegend.js +2 -2
- package/dist/ProfileView/VisualizationPanel.d.ts +4 -1
- package/dist/ProfileView/VisualizationPanel.d.ts.map +1 -1
- package/dist/ProfileView/VisualizationPanel.js +4 -6
- package/dist/ProfileView/index.d.ts.map +1 -1
- package/dist/ProfileView/index.js +33 -10
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +1 -3
- package/dist/Table/index.d.ts +2 -29
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +52 -159
- package/dist/Table/utils/functions.d.ts +49 -0
- package/dist/Table/utils/functions.d.ts.map +1 -0
- package/dist/Table/utils/functions.js +181 -0
- package/dist/components/ActionButtons/GroupByDropdown.js +1 -1
- package/dist/components/ActionButtons/SortByDropdown.d.ts +3 -0
- package/dist/components/ActionButtons/SortByDropdown.d.ts.map +1 -0
- package/dist/components/ActionButtons/SortByDropdown.js +49 -0
- package/dist/components/VisualisationToolbar/MultiLevelDropdown.d.ts.map +1 -1
- package/dist/components/VisualisationToolbar/MultiLevelDropdown.js +3 -27
- package/dist/components/VisualisationToolbar/TableColumnsDropdown.d.ts.map +1 -1
- package/dist/components/VisualisationToolbar/TableColumnsDropdown.js +3 -1
- package/dist/components/VisualisationToolbar/index.d.ts +11 -0
- package/dist/components/VisualisationToolbar/index.d.ts.map +1 -1
- package/dist/components/VisualisationToolbar/index.js +13 -6
- package/dist/styles.css +1 -1
- package/package.json +4 -3
- package/src/MetricsGraphStrips/AreaGraph/index.tsx +321 -0
- package/src/MetricsGraphStrips/MetricsGraphStrips.stories.tsx +57 -0
- package/src/MetricsGraphStrips/TimelineGuide/index.tsx +111 -0
- package/src/MetricsGraphStrips/index.tsx +93 -0
- package/src/ProfileIcicleGraph/index.tsx +2 -18
- package/src/{ProfileIcicleGraph/IcicleGraphArrow → ProfileView}/ColorStackLegend.tsx +2 -2
- package/src/ProfileView/VisualizationPanel.tsx +13 -10
- package/src/ProfileView/index.tsx +59 -9
- package/src/ProfileViewWithData.tsx +1 -3
- package/src/Table/index.tsx +121 -263
- package/src/Table/utils/functions.ts +284 -0
- package/src/components/ActionButtons/GroupByDropdown.tsx +1 -1
- package/src/components/ActionButtons/SortByDropdown.tsx +84 -0
- package/src/components/VisualisationToolbar/MultiLevelDropdown.tsx +7 -30
- package/src/components/VisualisationToolbar/TableColumnsDropdown.tsx +3 -1
- package/src/components/VisualisationToolbar/index.tsx +103 -58
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/ColorStackLegend.d.ts.map +0 -1
- /package/dist/{ProfileIcicleGraph/IcicleGraphArrow → ProfileView}/ColorStackLegend.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.445](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.444...@parca/profile@0.16.445) (2024-11-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.16.444](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.443...@parca/profile@0.16.444) (2024-11-14)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.16.443](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.442...@parca/profile@0.16.443) (2024-11-12)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DataPoint {
|
|
2
|
+
timestamp: number;
|
|
3
|
+
value: number;
|
|
4
|
+
}
|
|
5
|
+
export type NumberDuo = [number, number];
|
|
6
|
+
interface Props {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
marginLeft?: number;
|
|
10
|
+
marginRight?: number;
|
|
11
|
+
marginTop?: number;
|
|
12
|
+
marginBottom?: number;
|
|
13
|
+
fill?: string;
|
|
14
|
+
data: DataPoint[];
|
|
15
|
+
selectionBounds?: NumberDuo | undefined;
|
|
16
|
+
setSelectionBounds: (newBounds: NumberDuo | undefined) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const AreaGraph: ({ data, height, width, marginLeft, marginRight, marginBottom, marginTop, fill, selectionBounds, setSelectionBounds, }: Props) => JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraphStrips/AreaGraph/index.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzC,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,eAAe,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACxC,kBAAkB,EAAE,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;CAChE;AA8JD,eAAO,MAAM,SAAS,0HAWnB,KAAK,KAAG,GAAG,CAAC,OAkHd,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { jsx as _jsx, 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 { useEffect, useMemo, useRef, useState } from 'react';
|
|
15
|
+
import { Icon } from '@iconify/react';
|
|
16
|
+
import cx from 'classnames';
|
|
17
|
+
import * as d3 from 'd3';
|
|
18
|
+
const DraggingWindow = ({ dragStart, currentX, }) => {
|
|
19
|
+
const start = useMemo(() => Math.min(dragStart ?? 0, currentX ?? 0), [dragStart, currentX]);
|
|
20
|
+
const width = useMemo(() => Math.abs((dragStart ?? 0) - (currentX ?? 0)), [dragStart, currentX]);
|
|
21
|
+
if (dragStart === undefined || currentX === undefined) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return (_jsx("div", { style: { height: '100%', width, left: start }, className: cx('bg-gray-500 absolute top-0 opacity-50 border-x-2 border-gray-900 dark:border-gray-100') }));
|
|
25
|
+
};
|
|
26
|
+
const ZoomWindow = ({ zoomWindow, width, onZoomWindowChange, setIsHoveringDragHandle, }) => {
|
|
27
|
+
const windowStartHandleRef = useRef(null);
|
|
28
|
+
const windowEndHandleRef = useRef(null);
|
|
29
|
+
const [zoomWindowState, setZoomWindowState] = useState(zoomWindow);
|
|
30
|
+
const [dragginStart, setDraggingStart] = useState(false);
|
|
31
|
+
const [draggingEnd, setDraggingEnd] = useState(false);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (zoomWindow === undefined ||
|
|
34
|
+
zoomWindowState === undefined ||
|
|
35
|
+
zoomWindow[0] !== zoomWindowState[0] ||
|
|
36
|
+
zoomWindow[1] !== zoomWindowState[1]) {
|
|
37
|
+
setZoomWindowState(zoomWindow);
|
|
38
|
+
}
|
|
39
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
+
}, [zoomWindow]);
|
|
41
|
+
if (zoomWindowState === undefined) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const beforeStart = 0;
|
|
45
|
+
const beforeWidth = zoomWindowState[0];
|
|
46
|
+
const afterStart = zoomWindowState[1];
|
|
47
|
+
const afterWidth = width - zoomWindowState[1];
|
|
48
|
+
return (_jsxs("div", { className: "absolute w-full h-full", onMouseMove: e => {
|
|
49
|
+
if (dragginStart) {
|
|
50
|
+
const [x] = d3.pointer(e);
|
|
51
|
+
if (x >= afterStart - 10) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const newStart = Math.min(x, afterStart);
|
|
55
|
+
const newEnd = Math.max(x, afterStart);
|
|
56
|
+
setZoomWindowState([newStart, newEnd]);
|
|
57
|
+
}
|
|
58
|
+
if (draggingEnd) {
|
|
59
|
+
const [x] = d3.pointer(e);
|
|
60
|
+
if (x <= beforeWidth + 10) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const newStart = Math.min(x, beforeWidth);
|
|
64
|
+
const newEnd = Math.max(x, beforeWidth);
|
|
65
|
+
setZoomWindowState([newStart, newEnd]);
|
|
66
|
+
}
|
|
67
|
+
}, onMouseLeave: () => {
|
|
68
|
+
setDraggingStart(false);
|
|
69
|
+
setDraggingEnd(false);
|
|
70
|
+
}, onMouseUp: () => {
|
|
71
|
+
if (dragginStart) {
|
|
72
|
+
setDraggingStart(false);
|
|
73
|
+
}
|
|
74
|
+
if (draggingEnd) {
|
|
75
|
+
setDraggingEnd(false);
|
|
76
|
+
}
|
|
77
|
+
if (zoomWindowState[0] === zoomWindow?.[0] && zoomWindowState[1] === zoomWindow?.[1]) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
onZoomWindowChange(zoomWindowState);
|
|
81
|
+
setZoomWindowState(undefined);
|
|
82
|
+
}, children: [_jsx("div", { style: { height: '100%', width: beforeWidth, left: beforeStart }, className: cx('bg-gray-500/50 absolute top-0 border-r-2 border-gray-900 dark:border-gray-100 z-20'), children: _jsx("div", { className: "w-3 h-4 absolute top-0 right-[-7px] rounded-b bg-gray-200 cursor-ew-resize flex justify-center", onMouseDown: e => {
|
|
83
|
+
setDraggingStart(true);
|
|
84
|
+
e.stopPropagation();
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
}, ref: windowStartHandleRef, onMouseEnter: () => {
|
|
87
|
+
setIsHoveringDragHandle(true);
|
|
88
|
+
}, onMouseLeave: () => {
|
|
89
|
+
setIsHoveringDragHandle(false);
|
|
90
|
+
}, children: _jsx(Icon, { icon: "si:drag-handle-line", className: "rotate-90", fontSize: 16 }) }) }), _jsx("div", { style: { height: '100%', width: afterWidth, left: afterStart }, className: cx('bg-gray-500/50 absolute top-0 border-l-2 border-gray-900 dark:border-gray-100'), children: _jsx("div", { className: "w-3 h-4 absolute top-0 rounded-b bg-gray-200 cursor-ew-resize flex justify-center left-[-7px]", onMouseDown: e => {
|
|
91
|
+
setDraggingEnd(true);
|
|
92
|
+
e.stopPropagation();
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
}, ref: windowEndHandleRef, onMouseEnter: () => {
|
|
95
|
+
setIsHoveringDragHandle(true);
|
|
96
|
+
}, onMouseLeave: () => {
|
|
97
|
+
setIsHoveringDragHandle(false);
|
|
98
|
+
}, children: _jsx(Icon, { icon: "si:drag-handle-line", className: "rotate-90", fontSize: 16 }) }) })] }));
|
|
99
|
+
};
|
|
100
|
+
export const AreaGraph = ({ data, height, width, marginLeft = 0, marginRight = 0, marginBottom = 0, marginTop = 0, fill = 'gray', selectionBounds, setSelectionBounds, }) => {
|
|
101
|
+
const [mousePosition, setMousePosition] = useState(undefined);
|
|
102
|
+
const [dragStart, setDragStart] = useState(undefined);
|
|
103
|
+
const [isHoveringDragHandle, setIsHoveringDragHandle] = useState(false);
|
|
104
|
+
const isDragging = dragStart !== undefined;
|
|
105
|
+
// Declare the x (horizontal position) scale.
|
|
106
|
+
const x = d3.scaleUtc(d3.extent(data, d => d.timestamp), [
|
|
107
|
+
marginLeft,
|
|
108
|
+
width - marginRight,
|
|
109
|
+
]);
|
|
110
|
+
// Declare the y (vertical position) scale.
|
|
111
|
+
const y = d3.scaleLinear([0, d3.max(data, d => d.value)], [height - marginBottom, marginTop]);
|
|
112
|
+
const area = d3
|
|
113
|
+
.area()
|
|
114
|
+
.curve(d3.curveMonotoneX)
|
|
115
|
+
.x(d => x(d.timestamp))
|
|
116
|
+
.y0(y(0))
|
|
117
|
+
.y1(d => y(d.value));
|
|
118
|
+
const zoomWindow = useMemo(() => {
|
|
119
|
+
if (selectionBounds === undefined) {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
return [x(selectionBounds[0]), x(selectionBounds[1])];
|
|
123
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
124
|
+
}, [selectionBounds]);
|
|
125
|
+
const setSelectionBoundsWithScaling = ([startPx, endPx]) => {
|
|
126
|
+
setSelectionBounds([x.invert(startPx).getTime(), x.invert(endPx).getTime()]);
|
|
127
|
+
};
|
|
128
|
+
return (_jsxs("div", { style: { height, width }, onMouseMove: e => {
|
|
129
|
+
const [x, y] = d3.pointer(e);
|
|
130
|
+
setMousePosition([x, y]);
|
|
131
|
+
}, onMouseLeave: () => {
|
|
132
|
+
setMousePosition(undefined);
|
|
133
|
+
setDragStart(undefined);
|
|
134
|
+
}, onMouseDown: e => {
|
|
135
|
+
// only left mouse button
|
|
136
|
+
if (e.button !== 0) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
// X/Y coordinate array relative to svg
|
|
140
|
+
const rel = d3.pointer(e);
|
|
141
|
+
const xCoordinate = rel[0];
|
|
142
|
+
const xCoordinateWithoutMargin = xCoordinate - marginLeft;
|
|
143
|
+
if (xCoordinateWithoutMargin >= 0) {
|
|
144
|
+
setDragStart(xCoordinateWithoutMargin);
|
|
145
|
+
}
|
|
146
|
+
e.stopPropagation();
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
}, onMouseUp: e => {
|
|
149
|
+
if (dragStart === undefined) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const rel = d3.pointer(e);
|
|
153
|
+
const xCoordinate = rel[0];
|
|
154
|
+
const xCoordinateWithoutMargin = xCoordinate - marginLeft;
|
|
155
|
+
if (xCoordinateWithoutMargin >= 0 && dragStart !== xCoordinateWithoutMargin) {
|
|
156
|
+
const start = Math.min(dragStart, xCoordinateWithoutMargin);
|
|
157
|
+
const end = Math.max(dragStart, xCoordinateWithoutMargin);
|
|
158
|
+
setSelectionBoundsWithScaling([start, end]);
|
|
159
|
+
}
|
|
160
|
+
setDragStart(undefined);
|
|
161
|
+
}, className: "relative", children: [_jsx("div", { style: { height, width: 2, left: mousePosition?.[0] ?? -1 }, className: cx('bg-gray-700/75 dark:bg-gray-200/75 absolute top-0', {
|
|
162
|
+
hidden: mousePosition === undefined || isDragging || isHoveringDragHandle,
|
|
163
|
+
}) }), _jsx(DraggingWindow, { dragStart: dragStart, currentX: mousePosition?.[0] }), _jsx(ZoomWindow, { zoomWindow: zoomWindow, width: width, onZoomWindowChange: setSelectionBoundsWithScaling, setIsHoveringDragHandle: setIsHoveringDragHandle }), _jsx("div", { className: cx('absolute top-0 left-0 w-full h-full bg-gray-900/50 dark:bg-gray-200/50', {
|
|
164
|
+
hidden: isDragging || selectionBounds !== undefined,
|
|
165
|
+
}) }), _jsx("svg", { style: { width: '100%', height: '100%' }, children: _jsx("path", { fill: fill, d: area(data), className: "opacity-80" }) })] }));
|
|
166
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { DataPoint, NumberDuo } from './AreaGraph';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const ThreeCPUStrips: {
|
|
6
|
+
args: {
|
|
7
|
+
cpus: string[];
|
|
8
|
+
data: DataPoint[][];
|
|
9
|
+
selectedTimeline: {
|
|
10
|
+
index: number;
|
|
11
|
+
bounds: number[];
|
|
12
|
+
};
|
|
13
|
+
onSelectedTimeline: (index: number, bounds: NumberDuo) => void;
|
|
14
|
+
};
|
|
15
|
+
render: (args: any) => JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=MetricsGraphStrips.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetricsGraphStrips.stories.d.ts","sourceRoot":"","sources":["../../src/MetricsGraphStrips/MetricsGraphStrips.stories.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAC,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AAajD,QAAA,MAAM,IAAI,EAAE,IAGX,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,cAAc;;;;;;;;oCAKK,MAAM,UAAU,SAAS,KAAG,IAAI;;mBAI7B,GAAG,KAAG,GAAG,CAAC,OAAO;CAUnD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
// eslint-disable-next-line import/named
|
|
15
|
+
import { useArgs } from '@storybook/preview-api';
|
|
16
|
+
import { MetricsGraphStrips } from './index';
|
|
17
|
+
const mockData = [[], [], []];
|
|
18
|
+
for (let i = 0; i < 200; i++) {
|
|
19
|
+
for (let j = 0; j < mockData.length; j++) {
|
|
20
|
+
mockData[j].push({
|
|
21
|
+
timestamp: 1731326092000 + i * 100,
|
|
22
|
+
value: Math.floor(Math.random() * 100),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const meta = {
|
|
27
|
+
title: 'components/MetricsGraphStrips',
|
|
28
|
+
component: MetricsGraphStrips,
|
|
29
|
+
};
|
|
30
|
+
export default meta;
|
|
31
|
+
export const ThreeCPUStrips = {
|
|
32
|
+
args: {
|
|
33
|
+
cpus: Array.from(mockData, (_, i) => `CPU ${i + 1}`),
|
|
34
|
+
data: mockData,
|
|
35
|
+
selectedTimeline: { index: 1, bounds: [mockData[0][25].timestamp, mockData[0][100].timestamp] },
|
|
36
|
+
onSelectedTimeline: (index, bounds) => {
|
|
37
|
+
console.log('onSelectedTimeline', index, bounds);
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
render: function Component(args) {
|
|
41
|
+
const [, setArgs] = useArgs();
|
|
42
|
+
const onSelectedTimeline = (index, bounds) => {
|
|
43
|
+
args.onSelectedTimeline(index, bounds);
|
|
44
|
+
setArgs({ ...args, selectedTimeline: { index, bounds } });
|
|
45
|
+
};
|
|
46
|
+
return _jsx(MetricsGraphStrips, { ...args, onSelectedTimeline: onSelectedTimeline });
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DataPoint } from '../AreaGraph';
|
|
2
|
+
interface Props {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
margin: number;
|
|
6
|
+
data: DataPoint[][];
|
|
7
|
+
}
|
|
8
|
+
export declare const TimelineGuide: ({ data, width, height, margin }: Props) => JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MetricsGraphStrips/TimelineGuide/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,SAAS,EAAY,MAAM,cAAc,CAAC;AAElD,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;CACrB;AAaD,eAAO,MAAM,aAAa,oCAAmC,KAAK,KAAG,GAAG,CAAC,OAyExE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs as _jsxs, 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 { Fragment, useMemo } from 'react';
|
|
15
|
+
import * as d3 from 'd3';
|
|
16
|
+
const alignBeforeAxisCorrection = (val) => {
|
|
17
|
+
if (val < 10000) {
|
|
18
|
+
return -24;
|
|
19
|
+
}
|
|
20
|
+
if (val < 100000) {
|
|
21
|
+
return -28;
|
|
22
|
+
}
|
|
23
|
+
return 0;
|
|
24
|
+
};
|
|
25
|
+
export const TimelineGuide = ({ data, width, height, margin }) => {
|
|
26
|
+
const bounds = useMemo(() => {
|
|
27
|
+
const bounds = [Infinity, -Infinity];
|
|
28
|
+
data.forEach(cpuData => {
|
|
29
|
+
cpuData.forEach(dataPoint => {
|
|
30
|
+
bounds[0] = Math.min(bounds[0], dataPoint.timestamp);
|
|
31
|
+
bounds[1] = Math.max(bounds[1], dataPoint.timestamp);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
return [0, bounds[1] - bounds[0]];
|
|
35
|
+
}, [data]);
|
|
36
|
+
const xScale = d3.scaleLinear().domain(bounds).range([0, width]);
|
|
37
|
+
return (_jsx("div", { className: "relative h-4", children: _jsx("div", { className: "absolute", style: { width, height }, children: _jsx("svg", { style: { width: '100%', height: '100%' }, children: _jsxs("g", { className: "x axis", fill: "none", fontSize: "10", textAnchor: "middle", transform: `translate(0,${height - margin})`, children: [xScale.ticks().map((d, i) => (_jsxs(Fragment, { children: [_jsx("g", { className: "tick",
|
|
38
|
+
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions */
|
|
39
|
+
transform: `translate(${xScale(d) + alignBeforeAxisCorrection(d)}, ${-height})`, children: _jsxs("text", { fill: "currentColor", dy: ".71em", y: 9, children: [d, " ms"] }) }, `tick-${i}`), _jsx("g", { children: _jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x1: xScale(d), x2: xScale(d), y1: 0, y2: -height + margin }) }, `grid-${i}`)] }, `${i.toString()}-${d.toString()}`))), _jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x1: 0, x2: width, y1: -height + 1, y2: -height + 1 }), _jsx("line", { className: "stroke-gray-300 dark:stroke-gray-500", x1: 0, x2: width, y1: -height + 20, y2: -height + 20 })] }) }) }) }));
|
|
40
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataPoint, NumberDuo } from './AreaGraph';
|
|
2
|
+
interface Props {
|
|
3
|
+
cpus: string[];
|
|
4
|
+
data: DataPoint[][];
|
|
5
|
+
selectedTimeline?: {
|
|
6
|
+
index: number;
|
|
7
|
+
bounds: NumberDuo;
|
|
8
|
+
};
|
|
9
|
+
onSelectedTimeline: (index: number, bounds: NumberDuo | undefined) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const MetricsGraphStrips: ({ cpus, data, selectedTimeline, onSelectedTimeline, }: Props) => JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MetricsGraphStrips/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAY,SAAS,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AAG5D,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;IACpB,gBAAgB,CAAC,EAAE;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,SAAS,CAAC;KACnB,CAAC;IACF,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;CAC5E;AAMD,eAAO,MAAM,kBAAkB,0DAK5B,KAAK,KAAG,GAAG,CAAC,OAoDd,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, 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 { useState } from 'react';
|
|
15
|
+
import { Icon } from '@iconify/react';
|
|
16
|
+
import * as d3 from 'd3';
|
|
17
|
+
import { AreaGraph } from './AreaGraph';
|
|
18
|
+
import { TimelineGuide } from './TimelineGuide';
|
|
19
|
+
const getTimelineGuideHeight = (cpus, collapsedIndices) => {
|
|
20
|
+
return 56 * (cpus.length - collapsedIndices.length) + 20 * collapsedIndices.length + 24;
|
|
21
|
+
};
|
|
22
|
+
export const MetricsGraphStrips = ({ cpus, data, selectedTimeline, onSelectedTimeline, }) => {
|
|
23
|
+
const [collapsedIndices, setCollapsedIndices] = useState([]);
|
|
24
|
+
// @ts-expect-error
|
|
25
|
+
const color = d3.scaleOrdinal(d3.schemeObservable10);
|
|
26
|
+
return (_jsxs("div", { className: "flex flex-col gap-1 relative", children: [_jsx(TimelineGuide, { data: data, width: 1468, height: getTimelineGuideHeight(cpus, collapsedIndices), margin: 1 }), cpus.map((cpu, i) => {
|
|
27
|
+
const isCollapsed = collapsedIndices.includes(i);
|
|
28
|
+
return (_jsxs("div", { className: "relative min-h-5", children: [_jsxs("div", { className: "text-xs absolute top-0 left-0 flex gap-[2px] items-center bg-white/50 px-1 rounded-sm cursor-pointer z-30", onClick: () => {
|
|
29
|
+
const newCollapsedIndices = [...collapsedIndices];
|
|
30
|
+
if (collapsedIndices.includes(i)) {
|
|
31
|
+
newCollapsedIndices.splice(newCollapsedIndices.indexOf(i), 1);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
newCollapsedIndices.push(i);
|
|
35
|
+
}
|
|
36
|
+
setCollapsedIndices(newCollapsedIndices);
|
|
37
|
+
}, children: [_jsx(Icon, { icon: isCollapsed ? 'bxs:right-arrow' : 'bxs:down-arrow' }), cpu] }), !isCollapsed ? (_jsx(AreaGraph, { data: data[i], height: 56, width: 1468, fill: color(i.toString()), selectionBounds: selectedTimeline?.index === i ? selectedTimeline.bounds : undefined, setSelectionBounds: bounds => {
|
|
38
|
+
onSelectedTimeline(i, bounds);
|
|
39
|
+
} })) : null] }, cpu));
|
|
40
|
+
})] }));
|
|
41
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileIcicleGraph/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAqC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileIcicleGraph/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAI1D,OAAO,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAW1C,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAEpE,UAAU,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACvB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC;IACxD,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,YAAY,EAAE,OAAO,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAMD,QAAA,MAAM,kBAAkB,uIAarB,uBAAuB,KAAG,GAAG,CAAC,OA+KhC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -12,16 +12,14 @@ 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 { useEffect, useMemo, useState } from 'react';
|
|
15
|
-
import { tableFromIPC } from 'apache-arrow';
|
|
16
15
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
17
16
|
import { IcicleGraphSkeleton, useParcaContext, useURLState } from '@parca/components';
|
|
18
|
-
import { capitalizeOnlyFirstLetter, divide
|
|
17
|
+
import { capitalizeOnlyFirstLetter, divide } from '@parca/utilities';
|
|
19
18
|
import { useProfileViewContext } from '../ProfileView/ProfileViewContext';
|
|
20
19
|
import DiffLegend from '../components/DiffLegend';
|
|
21
20
|
import { IcicleGraph } from './IcicleGraph';
|
|
22
21
|
import { FIELD_FUNCTION_NAME, IcicleGraphArrow } from './IcicleGraphArrow';
|
|
23
|
-
import
|
|
24
|
-
import useMappingList, { useFilenamesList } from './IcicleGraphArrow/useMappingList';
|
|
22
|
+
import useMappingList from './IcicleGraphArrow/useMappingList';
|
|
25
23
|
const numberFormatter = new Intl.NumberFormat('en-US');
|
|
26
24
|
const ErrorContent = ({ errorMessage }) => {
|
|
27
25
|
return _jsx("div", { className: "flex justify-center p-10", children: errorMessage });
|
|
@@ -30,12 +28,7 @@ const ProfileIcicleGraph = function ProfileIcicleGraphNonMemo({ graph, arrow, to
|
|
|
30
28
|
const { onError, authenticationErrorMessage, isDarkMode } = useParcaContext();
|
|
31
29
|
const { compareMode } = useProfileViewContext();
|
|
32
30
|
const [isLoading, setIsLoading] = useState(true);
|
|
33
|
-
const isColorStackLegendEnabled = selectQueryParam('color_stack_legend') === 'true';
|
|
34
|
-
const table = useMemo(() => {
|
|
35
|
-
return arrow !== undefined ? tableFromIPC(arrow.record) : null;
|
|
36
|
-
}, [arrow]);
|
|
37
31
|
const mappingsList = useMappingList(metadataMappingFiles);
|
|
38
|
-
const filenamesList = useFilenamesList(table);
|
|
39
32
|
const [storeSortBy = FIELD_FUNCTION_NAME] = useURLState('sort_by');
|
|
40
33
|
const [colorBy, setColorBy] = useURLState('color_by');
|
|
41
34
|
// By default, we want delta profiles (CPU) to be relatively compared.
|
|
@@ -43,7 +36,6 @@ const ProfileIcicleGraph = function ProfileIcicleGraphNonMemo({ graph, arrow, to
|
|
|
43
36
|
const compareAbsoluteDefault = profileType?.delta === false ? 'true' : 'false';
|
|
44
37
|
const [compareAbsolute = compareAbsoluteDefault] = useURLState('compare_absolute');
|
|
45
38
|
const isCompareAbsolute = compareAbsolute === 'true';
|
|
46
|
-
const colorByValue = colorBy === undefined || colorBy === '' ? 'binary' : colorBy;
|
|
47
39
|
const mappingsListCount = useMemo(() => mappingsList.filter(m => m !== '').length, [mappingsList]);
|
|
48
40
|
const [totalFormatted, totalUnfilteredFormatted, isTrimmed, trimmedFormatted, trimmedPercentage, isFiltered, filteredPercentage,] = useMemo(() => {
|
|
49
41
|
if (graph === undefined && arrow === undefined) {
|
|
@@ -118,6 +110,6 @@ const ProfileIcicleGraph = function ProfileIcicleGraphNonMemo({ graph, arrow, to
|
|
|
118
110
|
if (isTrimmed) {
|
|
119
111
|
console.info(`Trimmed ${trimmedFormatted} (${trimmedPercentage}%) too small values.`);
|
|
120
112
|
}
|
|
121
|
-
return (_jsx(AnimatePresence, { children: _jsxs(motion.div, { className: "relative h-full w-full", initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.5 }, children: [compareMode ? _jsx(DiffLegend, {}) : null,
|
|
113
|
+
return (_jsx(AnimatePresence, { children: _jsxs(motion.div, { className: "relative h-full w-full", initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.5 }, children: [compareMode ? _jsx(DiffLegend, {}) : null, _jsx("div", { className: "min-h-48", id: "h-icicle-graph", children: _jsx(_Fragment, { children: icicleGraph }) }), _jsxs("p", { className: "my-2 text-xs", children: ["Showing ", totalFormatted, ' ', isFiltered ? (_jsxs("span", { children: ["(", filteredPercentage, "%) filtered of ", totalUnfilteredFormatted, ' '] })) : (_jsx(_Fragment, {})), "values.", ' '] })] }, "icicle-graph-loaded") }));
|
|
122
114
|
};
|
|
123
115
|
export default ProfileIcicleGraph;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorStackLegend.d.ts","sourceRoot":"","sources":["../../src/ProfileView/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 '
|
|
21
|
-
import useMappingList from '
|
|
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();
|
|
@@ -9,8 +9,11 @@ interface Props {
|
|
|
9
9
|
getDashboardItemByType: (props: {
|
|
10
10
|
type: string;
|
|
11
11
|
isHalfScreen: boolean;
|
|
12
|
-
setActionButtons: (actionButtons: JSX.Element) => void;
|
|
13
12
|
}) => JSX.Element;
|
|
13
|
+
actionButtons: {
|
|
14
|
+
icicle: JSX.Element;
|
|
15
|
+
table: JSX.Element;
|
|
16
|
+
};
|
|
14
17
|
}
|
|
15
18
|
export declare const VisualizationPanel: React.NamedExoticComponent<Props>;
|
|
16
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisualizationPanel.d.ts","sourceRoot":"","sources":["../../src/ProfileView/VisualizationPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,
|
|
1
|
+
{"version":3,"file":"VisualizationPanel.d.ts","sourceRoot":"","sources":["../../src/ProfileView/VisualizationPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAC,gCAAgC,EAAC,MAAM,qBAAqB,CAAC;AAK1E,UAAU,KAAK;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,eAAe,EAAE,gCAAgC,GAAG,IAAI,GAAG,SAAS,CAAC;IACrE,sBAAsB,EAAE,CAAC,KAAK,EAAE;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,OAAO,CAAA;KAAC,KAAK,GAAG,CAAC,OAAO,CAAC;IACtF,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
// Copyright 2022 The Parca Authors
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,17 +11,15 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import React
|
|
14
|
+
import React from 'react';
|
|
15
15
|
import { Icon } from '@iconify/react';
|
|
16
16
|
import cx from 'classnames';
|
|
17
17
|
import { IconButton, useParcaContext } from '@parca/components';
|
|
18
18
|
import { CloseIcon } from '@parca/icons';
|
|
19
|
-
export const VisualizationPanel = React.memo(function VisualizationPanel({ dashboardItem, isMultiPanelView, handleClosePanel, dragHandleProps, getDashboardItemByType, }) {
|
|
20
|
-
const [actionButtons, setActionButtons] = useState(_jsx(_Fragment, {}));
|
|
19
|
+
export const VisualizationPanel = React.memo(function VisualizationPanel({ dashboardItem, isMultiPanelView, handleClosePanel, dragHandleProps, getDashboardItemByType, actionButtons, }) {
|
|
21
20
|
const { flamegraphHint } = useParcaContext();
|
|
22
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full items-center justify-end gap-2 pb-2", children: [_jsxs("div", { className: cx('flex w-full justify-between flex-col-reverse md:flex-row', isMultiPanelView && dashboardItem === 'icicle' ? 'items-end gap-x-2' : 'items-end'), children: [_jsxs("div", { className: "flex items-center", children: [_jsx("div", { className: cx(isMultiPanelView ? '' : 'hidden', 'flex items-center'), ...dragHandleProps, children: _jsx(Icon, { className: "text-xl", icon: "material-symbols:drag-indicator" }) }), _jsx("div", { className: "flex gap-2", children: actionButtons })] }), _jsx("div", { className: cx('flex flex-row items-center gap-4', isMultiPanelView && dashboardItem === 'icicle' && 'pb-[10px]'), children: dashboardItem === 'icicle' && flamegraphHint != null ? (_jsx("div", { className: "px-2", children: flamegraphHint })) : null })] }), isMultiPanelView && (_jsx(IconButton, { className: "py-0", onClick: () => handleClosePanel(dashboardItem), icon: _jsx(CloseIcon, {}) }))] }), getDashboardItemByType({
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex w-full items-center justify-end gap-2 pb-2", children: [_jsxs("div", { className: cx('flex w-full justify-between flex-col-reverse md:flex-row', isMultiPanelView && dashboardItem === 'icicle' ? 'items-end gap-x-2' : 'items-end'), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: cx(isMultiPanelView ? '' : 'hidden', 'flex items-center'), ...dragHandleProps, children: _jsx(Icon, { className: "text-xl", icon: "material-symbols:drag-indicator" }) }), isMultiPanelView ? (_jsx("div", { className: "flex gap-2", children: actionButtons[dashboardItem] })) : null] }), _jsx("div", { className: cx('flex flex-row items-center gap-4', isMultiPanelView && dashboardItem === 'icicle' && 'pb-[10px]'), children: dashboardItem === 'icicle' && flamegraphHint != null ? (_jsx("div", { className: "px-2", children: flamegraphHint })) : null })] }), isMultiPanelView && (_jsx(IconButton, { className: "py-0", onClick: () => handleClosePanel(dashboardItem), icon: _jsx(CloseIcon, {}) }))] }), getDashboardItemByType({
|
|
23
22
|
type: dashboardItem,
|
|
24
23
|
isHalfScreen: isMultiPanelView,
|
|
25
|
-
setActionButtons,
|
|
26
24
|
})] }));
|
|
27
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileView/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileView/index.tsx"],"names":[],"mappings":"AA2BA,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,GAAG,EACJ,MAAM,eAAe,CAAC;AAavB,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAW/C,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,aAAa;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED,UAAU,UAAU;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,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,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAWD,eAAO,MAAM,WAAW,0JAYrB,gBAAgB,KAAG,GAAG,CAAC,OAuXzB,CAAC"}
|