Skip to content

Commit

Permalink
[ML] Single Metric Viewer: Fix brush update on short recent timespans. (
Browse files Browse the repository at this point in the history
#56125)

Fixes an issue where the context chart brush would render incorrectly for short recent time spans (e.g. 'now-15min`). Adds a check whether to display the brush and hide it if context and focus chart have the same timespan.
  • Loading branch information
walterra committed Jan 28, 2020
1 parent dc0b5f0 commit f34594c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ const TimeseriesChartIntl = injectI18n(
}
focusLoadTo = Math.min(focusLoadTo, contextXMax);

const brushVisibility = focusLoadFrom !== contextXMin || focusLoadTo !== contextXMax;
this.setBrushVisibility(brushVisibility);

if (focusLoadFrom !== contextXMin || focusLoadTo !== contextXMax) {
this.setContextBrushExtent(new Date(focusLoadFrom), new Date(focusLoadTo), true);
const newSelectedBounds = {
Expand Down

0 comments on commit f34594c

Please sign in to comment.