-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/441 "focus on this subtree" (#480)
* feat(webapp): allow focusing on a subtree allows focusing on a subtree of a flamegraph currently it's triggered by a menu item in the context menu (right click on the canvas) Co-authored-by: Ryan Perry <[email protected]> Co-authored-by: Dmitry Filimonov <[email protected]>
- Loading branch information
1 parent
38554ac
commit cfe0ae8
Showing
37 changed files
with
1,275 additions
and
673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-5 Bytes
(100%)
cypress/snapshots/basic.ts/pyroscope.server.inuse_objects-flamegraph.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-212 Bytes
(100%)
cypress/snapshots/basic.ts/pyroscope.server.inuse_space-flamegraph.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
cypress/snapshots/lang-smoke.ts/cart-service-dotnet-cpu-flamegraph.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,10 @@ fi | |
apt update -y | ||
apt install fontconfig -y | ||
|
||
yarn install | ||
# ignore-engines due to | ||
# warning [email protected]: Invalid bin field for "webpack-plugin-serve". | ||
# error [email protected]: The engine "node" is incompatible with this module. Expected version "^16 || ^15 || ^14 || ^13 || ^12 || ^11 || ^10 || ^9 || ^8 || ^7 || ^6". Got "17.0.1" | ||
# error Found incompatible module. | ||
yarn install --ignore-engines | ||
RUN_SNAPSHOTS=true yarn test --testNamePattern='group:snapshot' --verbose "$updateArg" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
webapp/javascript/components/FlameGraph/FlameGraphComponent/ContextMenuHighlight.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.highlightContextMenu { | ||
position: absolute; | ||
pointer-events: none; | ||
/* make it a bit lighter so that it's easier to distinguish when both highlights are on */ | ||
background: #ffffff8c; | ||
mix-blend-mode: overlay; | ||
} |
47 changes: 47 additions & 0 deletions
47
webapp/javascript/components/FlameGraph/FlameGraphComponent/ContextMenuHighlight.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react'; | ||
import { Option } from 'prelude-ts'; | ||
import styles from './ContextMenuHighlight.module.css'; | ||
|
||
export interface HighlightProps { | ||
// probably the same as the bar height | ||
barHeight: number; | ||
|
||
node: Option<{ top: number; left: number; width: number }>; | ||
} | ||
|
||
const initialSyle: React.CSSProperties = { | ||
height: '0px', | ||
visibility: 'hidden', | ||
}; | ||
|
||
/** | ||
* Highlight on the node that triggered the context menu | ||
*/ | ||
export default function ContextMenuHighlight(props: HighlightProps) { | ||
const { node, barHeight } = props; | ||
const [style, setStyle] = React.useState(initialSyle); | ||
|
||
React.useEffect( | ||
() => { | ||
node.match({ | ||
None: () => setStyle(initialSyle), | ||
Some: (data) => | ||
setStyle({ | ||
visibility: 'visible', | ||
height: `${barHeight}px`, | ||
...data, | ||
}), | ||
}); | ||
}, | ||
// refresh callback functions when they change | ||
[node] | ||
); | ||
|
||
return ( | ||
<div | ||
className={styles.highlightContextMenu} | ||
style={style} | ||
data-testid="flamegraph-highlight-contextmenu" | ||
/> | ||
); | ||
} |
Oops, something went wrong.