Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain inverted-ness when redrawing graph. #656

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions news/656.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Ensure flame graphs stay in flame mode when the user has selected it.
Previously clicking the "Hide Irrelevant Frames" or "Hide Import System Frames"
checkboxes would switch the flame graph back to icicle mode.
6 changes: 4 additions & 2 deletions src/memray/reporters/assets/flamegraph_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ export function initThreadsDropdown(data, merge_threads) {
}

export function drawChart(chart_data) {
// Retain the "invertedness" if there's an existing graph.
let invert = chart ? chart.inverted() : true;

// Clear any existing chart
if (chart) {
chart.destroy();
Expand All @@ -270,8 +273,7 @@ export function drawChart(chart_data) {
// smooth transitions
.transitionDuration(250)
.transitionEase(d3.easeCubic)
// invert the graph by default
.inverted(true)
.inverted(invert)
// make each row a little taller
.cellHeight(20)
// don't show elements that are less than 5px wide
Expand Down
2 changes: 1 addition & 1 deletion src/memray/reporters/templates/assets/flamegraph.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/memray/reporters/templates/assets/flamegraph_common.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading