xdmod icon indicating copy to clipboard operation
xdmod copied to clipboard

Fix zoom reseting to incorrect initial range values

Open aestoltm opened this issue 1 year ago • 0 comments

Description

When double clicking to reset the zoom level on peer jobs Plotly would reset the range for the axis to values different than the ones set manually. This is due to the chart being created in ChartTab.js initially and then being updated in GanttChart.js. The Plotly zoom reset functionality checks for the initial range created but we set it based on the data given in GanttChart.js,. This change fixes this by recreating the original plot when we receive data instead of updating it.

There is another solution by manipulating the chart div during a doubleClick event to set the initial range correctly. This could be a better solution due to Plotly.newPlot being slower than using Plotly.react.

NOTE: This behavior isn't observed in the timeseries charts because we have our chart settings configured before the graph is created for the first time.

Motivation and Context

The original implementation of the peer jobs had the xaxis range set to the current peer job walltime. Plotly auto-sizing the range during zoom reset breaks this original implementation

Tests performed

Tested on xdmod-dev

Checklist:

  • [x] The pull request description is suitable for a Changelog entry
  • [x] The milestone is set correctly on the pull request
  • [x] The appropriate labels have been added to the pull request

aestoltm avatar Aug 23 '23 17:08 aestoltm