@parca/profile 0.16.326 → 0.16.327

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,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.327 (2023-12-14)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.16.326](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.325...@parca/profile@0.16.326) (2023-12-06)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -156,14 +156,17 @@ export const RawMetricsGraph = ({ data, from, to, profile, onSampleClick, addLab
156
156
  setRelPos(-1);
157
157
  return;
158
158
  }
159
- const firstTime = xScale.invert(relPos).valueOf();
160
- const secondTime = xScale.invert(pos[0]).valueOf();
161
- if (firstTime > secondTime) {
162
- setTimeRange(DateTimeRange.fromAbsoluteDates(secondTime, firstTime));
163
- }
164
- else {
165
- setTimeRange(DateTimeRange.fromAbsoluteDates(firstTime, secondTime));
159
+ let startPos = relPos;
160
+ let endPos = pos[0];
161
+ if (startPos > endPos) {
162
+ startPos = pos[0];
163
+ endPos = relPos;
166
164
  }
165
+ const startCorrection = 10;
166
+ const endCorrection = 30;
167
+ const firstTime = xScale.invert(startPos - startCorrection).valueOf();
168
+ const secondTime = xScale.invert(endPos - endCorrection).valueOf();
169
+ setTimeRange(DateTimeRange.fromAbsoluteDates(firstTime, secondTime));
167
170
  setRelPos(-1);
168
171
  e.stopPropagation();
169
172
  e.preventDefault();
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.326",
3
+ "version": "0.16.327",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.100",
7
- "@parca/components": "^0.16.239",
7
+ "@parca/components": "^0.16.240",
8
8
  "@parca/dynamicsize": "^0.16.60",
9
9
  "@parca/hooks": "^0.0.38",
10
10
  "@parca/parser": "^0.16.68",
11
- "@parca/store": "^0.16.120",
12
- "@parca/utilities": "^0.0.48",
11
+ "@parca/store": "^0.16.121",
12
+ "@parca/utilities": "^0.0.49",
13
13
  "@tanstack/react-query": "^4.0.5",
14
14
  "@types/react-beautiful-dnd": "^13.1.3",
15
15
  "apache-arrow": "^12.0.0",
@@ -50,5 +50,5 @@
50
50
  "access": "public",
51
51
  "registry": "https://registry.npmjs.org/"
52
52
  },
53
- "gitHead": "961d3388824ea94af5bb47ea627b146ad14c23b5"
53
+ "gitHead": "39726283538379788de22955a17768ebe2da2fec"
54
54
  }
@@ -282,14 +282,22 @@ export const RawMetricsGraph = ({
282
282
  return;
283
283
  }
284
284
 
285
- const firstTime = xScale.invert(relPos).valueOf();
286
- const secondTime = xScale.invert(pos[0]).valueOf();
285
+ let startPos = relPos;
286
+ let endPos = pos[0];
287
287
 
288
- if (firstTime > secondTime) {
289
- setTimeRange(DateTimeRange.fromAbsoluteDates(secondTime, firstTime));
290
- } else {
291
- setTimeRange(DateTimeRange.fromAbsoluteDates(firstTime, secondTime));
288
+ if (startPos > endPos) {
289
+ startPos = pos[0];
290
+ endPos = relPos;
292
291
  }
292
+
293
+ const startCorrection = 10;
294
+ const endCorrection = 30;
295
+
296
+ const firstTime = xScale.invert(startPos - startCorrection).valueOf();
297
+ const secondTime = xScale.invert(endPos - endCorrection).valueOf();
298
+
299
+ setTimeRange(DateTimeRange.fromAbsoluteDates(firstTime, secondTime));
300
+
293
301
  setRelPos(-1);
294
302
 
295
303
  e.stopPropagation();