@parca/profile 0.12.36 → 0.13.0

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 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.13.0](https://github.com/parca-dev/parca/compare/ui-v0.12.38...ui-v0.13.0) (2022-05-30)
7
+
8
+ ### Features
9
+
10
+ - useContainerDimensions hook for smooth chart resize ([3fe5670](https://github.com/parca-dev/parca/commit/3fe5670cb94e838d83e5cb10d453ee620c2dc3c1))
11
+
12
+ ## [0.12.36](https://github.com/parca-dev/parca/compare/ui-v0.12.35...ui-v0.12.36) (2022-05-06)
13
+
6
14
  ## [0.12.36](https://github.com/parca-dev/parca/compare/ui-v0.12.35...ui-v0.12.36) (2022-05-06)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.12.36",
3
+ "version": "0.13.0",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
- "@parca/client": "^0.12.35",
7
- "@parca/dynamicsize": "^0.12.35",
8
- "@parca/parser": "^0.12.35",
6
+ "@parca/client": "^0.13.0",
7
+ "@parca/dynamicsize": "^0.13.0",
8
+ "@parca/parser": "^0.13.0",
9
9
  "d3-scale": "^4.0.2"
10
10
  },
11
11
  "main": "src/index.tsx",
@@ -19,5 +19,5 @@
19
19
  "access": "public",
20
20
  "registry": "https://registry.npmjs.org/"
21
21
  },
22
- "gitHead": "bf00c1edfc430b108a4457cc6943e1e160dca89c"
22
+ "gitHead": "4d00bb1f08c62bc8c33285f6844a0a4386f31442"
23
23
  }
@@ -521,9 +521,9 @@ export default function IcicleGraph({
521
521
  />
522
522
  <svg
523
523
  className="font-robotoMono"
524
- width={width}
525
- height={height}
526
524
  onMouseMove={onMouseMove}
525
+ viewBox={`0 0 ${width} ${height}`}
526
+ preserveAspectRatio="xMinYMid"
527
527
  ref={svg}
528
528
  >
529
529
  <g ref={ref}>
@@ -1,5 +1,6 @@
1
1
  import {Flamegraph} from '@parca/client';
2
2
  import {useAppSelector, selectCompareMode} from '@parca/store';
3
+ import {useContainerDimensions} from '@parca/dynamicsize';
3
4
 
4
5
  import DiffLegend from './components/DiffLegend';
5
6
  import IcicleGraph from './IcicleGraph';
@@ -13,7 +14,6 @@ interface ProfileIcicleGraphProps {
13
14
  }
14
15
 
15
16
  const ProfileIcicleGraph = ({
16
- width,
17
17
  graph,
18
18
  curPath,
19
19
  setNewCurPath,
@@ -25,16 +25,20 @@ const ProfileIcicleGraph = ({
25
25
  const total = graph.total;
26
26
  if (parseFloat(total) === 0) return <>Profile has no samples</>;
27
27
 
28
+ const {ref, dimensions} = useContainerDimensions();
29
+
28
30
  return (
29
31
  <>
30
32
  {compareMode && <DiffLegend />}
31
- <IcicleGraph
32
- width={width}
33
- graph={graph}
34
- curPath={curPath}
35
- setCurPath={setNewCurPath}
36
- sampleUnit={sampleUnit}
37
- />
33
+ <div ref={ref}>
34
+ <IcicleGraph
35
+ width={dimensions?.width}
36
+ graph={graph}
37
+ curPath={curPath}
38
+ setCurPath={setNewCurPath}
39
+ sampleUnit={sampleUnit}
40
+ />
41
+ </div>
38
42
  </>
39
43
  );
40
44
  };
@@ -1,10 +1,7 @@
1
1
  import React, {useEffect, useState} from 'react';
2
- import {CalcWidth} from '@parca/dynamicsize';
3
2
  import {parseParams} from '@parca/functions';
4
- import {QueryServiceClient, QueryResponse, QueryRequest_ReportType} from '@parca/client';
5
- import {RpcError} from '@protobuf-ts/runtime-rpc';
6
- import {Button, Card, Spinner, useGrpcMetadata, useParcaTheme} from '@parca/components';
7
- import * as parca_query_v1alpha1_query_pb from '@parca/client/src/parca/query/v1alpha1/query_pb';
3
+ import {QueryServiceClient, QueryRequest_ReportType} from '@parca/client';
4
+ import {Button, Card, useGrpcMetadata, useParcaTheme} from '@parca/components';
8
5
 
9
6
  import ProfileIcicleGraph from './ProfileIcicleGraph';
10
7
  import {ProfileSource} from './ProfileSource';
@@ -172,14 +169,12 @@ export const ProfileView = ({
172
169
  response !== null &&
173
170
  response.report.oneofKind === 'flamegraph' && (
174
171
  <div className="w-full">
175
- <CalcWidth throttle={300} delay={2000}>
176
- <ProfileIcicleGraph
177
- curPath={curPath}
178
- setNewCurPath={setNewCurPath}
179
- graph={response.report.flamegraph}
180
- sampleUnit={sampleUnit}
181
- />
182
- </CalcWidth>
172
+ <ProfileIcicleGraph
173
+ curPath={curPath}
174
+ setNewCurPath={setNewCurPath}
175
+ graph={response.report.flamegraph}
176
+ sampleUnit={sampleUnit}
177
+ />
183
178
  </div>
184
179
  )}
185
180
 
@@ -204,18 +199,16 @@ export const ProfileView = ({
204
199
  </div>
205
200
 
206
201
  <div className="w-1/2">
207
- <CalcWidth throttle={300} delay={2000}>
208
- <ProfileIcicleGraph
209
- curPath={curPath}
210
- setNewCurPath={setNewCurPath}
211
- graph={
212
- response?.report.oneofKind === 'flamegraph'
213
- ? response.report.flamegraph
214
- : undefined
215
- }
216
- sampleUnit={sampleUnit}
217
- />
218
- </CalcWidth>
202
+ <ProfileIcicleGraph
203
+ curPath={curPath}
204
+ setNewCurPath={setNewCurPath}
205
+ graph={
206
+ response?.report.oneofKind === 'flamegraph'
207
+ ? response.report.flamegraph
208
+ : undefined
209
+ }
210
+ sampleUnit={sampleUnit}
211
+ />
219
212
  </div>
220
213
  </>
221
214
  )}