Skip to content

Commit

Permalink
Retain inverted-ness when redrawing graph.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroIntensity committed Aug 1, 2024
1 parent fc06d9d commit afd3a44
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 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,10 @@ export function initThreadsDropdown(data, merge_threads) {
}

export function drawChart(chart_data) {
// In order to retain the "invertedness" when updating the graph, true
// by default.
let previouslyInverted = chart ? chart.inverted() : true;

// Clear any existing chart
if (chart) {
chart.destroy();
Expand All @@ -270,8 +274,7 @@ export function drawChart(chart_data) {
// smooth transitions
.transitionDuration(250)
.transitionEase(d3.easeCubic)
// invert the graph by default
.inverted(true)
.inverted(previouslyInverted)
// make each row a little taller
.cellHeight(20)
// don't show elements that are less than 5px wide
Expand Down

0 comments on commit afd3a44

Please sign in to comment.