@parca/profile 0.16.455 → 0.16.457
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/index.d.ts +1 -0
- package/dist/MetricsGraphStrips/index.d.ts.map +1 -1
- package/dist/MetricsGraphStrips/index.js +3 -3
- package/dist/ProfileIcicleGraph/IcicleGraph/index.js +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.d.ts +9 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.d.ts.map +1 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.js +51 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.d.ts +10 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.js +4 -3
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/TextWithEllipsis.d.ts +9 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/TextWithEllipsis.d.ts.map +1 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/TextWithEllipsis.js +62 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts +5 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/index.js +9 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/utils.d.ts +3 -0
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/utils.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/IcicleGraphArrow/utils.js +18 -0
- package/dist/ProfileIcicleGraph/index.d.ts +4 -1
- package/dist/ProfileIcicleGraph/index.d.ts.map +1 -1
- package/dist/ProfileIcicleGraph/index.js +6 -4
- package/dist/ProfileView/components/DashboardItems/index.d.ts +2 -1
- package/dist/ProfileView/components/DashboardItems/index.d.ts.map +1 -1
- package/dist/ProfileView/components/DashboardItems/index.js +7 -1
- package/dist/ProfileView/components/Toolbars/index.js +1 -1
- package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/index.js +4 -1
- package/dist/ProfileView/index.d.ts +1 -1
- package/dist/ProfileView/index.d.ts.map +1 -1
- package/dist/ProfileView/index.js +3 -2
- package/dist/ProfileView/types/visualization.d.ts +2 -4
- package/dist/ProfileView/types/visualization.d.ts.map +1 -1
- package/dist/ProfileViewWithData.d.ts +1 -4
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +30 -7
- package/dist/TimelineGuide/index.d.ts +4 -3
- package/dist/TimelineGuide/index.d.ts.map +1 -1
- package/dist/TimelineGuide/index.js +9 -7
- package/dist/styles.css +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/MetricsGraphStrips/index.tsx +3 -3
- package/src/ProfileIcicleGraph/IcicleGraph/index.tsx +1 -1
- package/src/ProfileIcicleGraph/IcicleGraphArrow/IcicleChartRootNode.tsx +157 -0
- package/src/ProfileIcicleGraph/IcicleGraphArrow/IcicleGraphNodes.tsx +10 -6
- package/src/ProfileIcicleGraph/IcicleGraphArrow/TextWithEllipsis.tsx +91 -0
- package/src/ProfileIcicleGraph/IcicleGraphArrow/index.tsx +58 -0
- package/src/ProfileIcicleGraph/IcicleGraphArrow/utils.ts +29 -1
- package/src/ProfileIcicleGraph/index.tsx +16 -6
- package/src/ProfileView/components/DashboardItems/index.tsx +27 -0
- package/src/ProfileView/components/Toolbars/index.tsx +1 -1
- package/src/ProfileView/components/ViewSelector/index.tsx +5 -1
- package/src/ProfileView/index.tsx +3 -3
- package/src/ProfileView/types/visualization.ts +2 -4
- package/src/ProfileViewWithData.tsx +36 -11
- package/src/TimelineGuide/index.tsx +41 -31
- package/src/utils.ts +1 -0
|
@@ -13,19 +13,20 @@
|
|
|
13
13
|
|
|
14
14
|
import {Fragment} from 'react';
|
|
15
15
|
|
|
16
|
-
import
|
|
16
|
+
import {scaleLinear, valueFormatter} from '@parca/utilities';
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import {BigIntDuo} from '../utils';
|
|
19
19
|
|
|
20
20
|
interface Props {
|
|
21
21
|
width: number;
|
|
22
22
|
height: number;
|
|
23
23
|
margin: number;
|
|
24
|
-
bounds:
|
|
24
|
+
bounds: BigIntDuo;
|
|
25
25
|
ticks?: number;
|
|
26
|
+
timeUnit?: string;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
const alignBeforeAxisCorrection = (val:
|
|
29
|
+
const alignBeforeAxisCorrection = (val: bigint): number => {
|
|
29
30
|
if (val < 10000) {
|
|
30
31
|
return -24;
|
|
31
32
|
}
|
|
@@ -36,11 +37,18 @@ const alignBeforeAxisCorrection = (val: number): number => {
|
|
|
36
37
|
return 0;
|
|
37
38
|
};
|
|
38
39
|
|
|
39
|
-
export const TimelineGuide = ({
|
|
40
|
-
|
|
40
|
+
export const TimelineGuide = ({
|
|
41
|
+
bounds,
|
|
42
|
+
width,
|
|
43
|
+
height,
|
|
44
|
+
margin,
|
|
45
|
+
ticks,
|
|
46
|
+
timeUnit = 'milliseconds',
|
|
47
|
+
}: Props): JSX.Element => {
|
|
48
|
+
const xScale = scaleLinear(bounds, [0, width]);
|
|
41
49
|
|
|
42
50
|
return (
|
|
43
|
-
<div className="relative h-
|
|
51
|
+
<div className="relative h-5">
|
|
44
52
|
<div className="absolute" style={{width, height}}>
|
|
45
53
|
<svg style={{width: '100%', height: '100%'}} className="z-[5]">
|
|
46
54
|
<g
|
|
@@ -50,30 +58,32 @@ export const TimelineGuide = ({bounds, width, height, margin, ticks}: Props): JS
|
|
|
50
58
|
textAnchor="middle"
|
|
51
59
|
transform={`translate(0,${height - margin})`}
|
|
52
60
|
>
|
|
53
|
-
{xScale.ticks(ticks).map((d, i) =>
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
61
|
+
{xScale.ticks(ticks).map((d, i) => {
|
|
62
|
+
return (
|
|
63
|
+
<Fragment key={`${i.toString()}-${d.toString()}`}>
|
|
64
|
+
<g
|
|
65
|
+
key={`tick-${i}`}
|
|
66
|
+
className="tick"
|
|
67
|
+
/* eslint-disable-next-line @typescript-eslint/restrict-template-expressions */
|
|
68
|
+
transform={`translate(${xScale(d) + alignBeforeAxisCorrection(d)}, ${-height})`}
|
|
69
|
+
>
|
|
70
|
+
{/* <line y2={6} className="stroke-gray-300 dark:stroke-gray-500" /> */}
|
|
71
|
+
<text fill="currentColor" dy=".71em" y={9}>
|
|
72
|
+
{valueFormatter(d - bounds[0], timeUnit, 2, true).toString()}
|
|
73
|
+
</text>
|
|
74
|
+
</g>
|
|
75
|
+
<g key={`grid-${i}`}>
|
|
76
|
+
<line
|
|
77
|
+
className="stroke-gray-300 dark:stroke-gray-500"
|
|
78
|
+
x1={xScale(d)}
|
|
79
|
+
x2={xScale(d)}
|
|
80
|
+
y1={0}
|
|
81
|
+
y2={-height + margin}
|
|
82
|
+
/>
|
|
83
|
+
</g>
|
|
84
|
+
</Fragment>
|
|
85
|
+
);
|
|
86
|
+
})}
|
|
77
87
|
<line
|
|
78
88
|
className="stroke-gray-300 dark:stroke-gray-500"
|
|
79
89
|
x1={0}
|
package/src/utils.ts
CHANGED