@parca/profile 0.16.173 → 0.16.174

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.174](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.173...@parca/profile@0.16.174) (2023-06-01)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## 0.16.173 (2023-06-01)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -135,6 +135,10 @@ export var RawMetricsGraph = function (_a) {
135
135
  };
136
136
  var highlighted = getClosest();
137
137
  var onMouseDown = function (e) {
138
+ // if shift is down, disable mouse behavior
139
+ if (isShiftDown) {
140
+ return;
141
+ }
138
142
  // only left mouse button
139
143
  if (e.button !== 0) {
140
144
  return;
@@ -157,6 +161,9 @@ export var RawMetricsGraph = function (_a) {
157
161
  }
158
162
  };
159
163
  var onMouseUp = function (e) {
164
+ if (isShiftDown) {
165
+ return;
166
+ }
160
167
  setDragging(false);
161
168
  if (relPos === -1) {
162
169
  // MouseDown happened outside of this element.
@@ -183,15 +190,17 @@ export var RawMetricsGraph = function (_a) {
183
190
  };
184
191
  var throttledSetPos = throttle(setPos, 20);
185
192
  var onMouseMove = function (e) {
193
+ // do not update position if shift is down because this means the user is locking the tooltip
194
+ if (isShiftDown) {
195
+ return;
196
+ }
186
197
  // X/Y coordinate array relative to svg
187
198
  var rel = pointer(e);
188
199
  var xCoordinate = rel[0];
189
200
  var xCoordinateWithoutMargin = xCoordinate - margin;
190
201
  var yCoordinate = rel[1];
191
202
  var yCoordinateWithoutMargin = yCoordinate - margin;
192
- if (!isShiftDown) {
193
- throttledSetPos([xCoordinateWithoutMargin, yCoordinateWithoutMargin]);
194
- }
203
+ throttledSetPos([xCoordinateWithoutMargin, yCoordinateWithoutMargin]);
195
204
  };
196
205
  var findSelectedProfile = function () {
197
206
  if (profile == null) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.173",
3
+ "version": "0.16.174",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.73",
7
- "@parca/components": "^0.16.138",
7
+ "@parca/components": "^0.16.139",
8
8
  "@parca/dynamicsize": "^0.16.54",
9
9
  "@parca/hooks": "^0.0.2",
10
10
  "@parca/parser": "^0.16.55",
@@ -46,5 +46,5 @@
46
46
  "access": "public",
47
47
  "registry": "https://registry.npmjs.org/"
48
48
  },
49
- "gitHead": "30457898590ff9bfdf0d5ab0abc4c2078f19759b"
49
+ "gitHead": "33196592dbe0ce078cc413325d1ec472ff11df28"
50
50
  }
@@ -221,6 +221,11 @@ export const RawMetricsGraph = ({
221
221
  const highlighted = getClosest();
222
222
 
223
223
  const onMouseDown = (e: React.MouseEvent<SVGSVGElement | HTMLDivElement, MouseEvent>): void => {
224
+ // if shift is down, disable mouse behavior
225
+ if (isShiftDown) {
226
+ return;
227
+ }
228
+
224
229
  // only left mouse button
225
230
  if (e.button !== 0) {
226
231
  return;
@@ -251,6 +256,10 @@ export const RawMetricsGraph = ({
251
256
  };
252
257
 
253
258
  const onMouseUp = (e: React.MouseEvent<SVGSVGElement | HTMLDivElement, MouseEvent>): void => {
259
+ if (isShiftDown) {
260
+ return;
261
+ }
262
+
254
263
  setDragging(false);
255
264
 
256
265
  if (relPos === -1) {
@@ -283,6 +292,11 @@ export const RawMetricsGraph = ({
283
292
  const throttledSetPos = throttle(setPos, 20);
284
293
 
285
294
  const onMouseMove = (e: React.MouseEvent<SVGSVGElement | HTMLDivElement, MouseEvent>): void => {
295
+ // do not update position if shift is down because this means the user is locking the tooltip
296
+ if (isShiftDown) {
297
+ return;
298
+ }
299
+
286
300
  // X/Y coordinate array relative to svg
287
301
  const rel = pointer(e);
288
302
 
@@ -291,9 +305,7 @@ export const RawMetricsGraph = ({
291
305
  const yCoordinate = rel[1];
292
306
  const yCoordinateWithoutMargin = yCoordinate - margin;
293
307
 
294
- if (!isShiftDown) {
295
- throttledSetPos([xCoordinateWithoutMargin, yCoordinateWithoutMargin]);
296
- }
308
+ throttledSetPos([xCoordinateWithoutMargin, yCoordinateWithoutMargin]);
297
309
  };
298
310
 
299
311
  const findSelectedProfile = (): HighlightedSeries | null => {