Skip to content

Commit

Permalink
🔨 fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Dec 11, 2024
1 parent ca219c1 commit 8f83696
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 7 additions & 4 deletions packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ import {
import {
autoDetectSeriesStrategy,
autoDetectYColumnSlugs,
byInteractionState,
byHoverThenFocusState,
getDefaultFailMessage,
getInteractionStateForSeries,
getSeriesKey,
Expand Down Expand Up @@ -115,6 +115,7 @@ import {
getColorKey,
getSeriesName,
} from "./LineChartHelpers"
import { InteractionArray } from "../selection/InteractionArray"

const LINE_CHART_CLASS_NAME = "LineChart"

Expand Down Expand Up @@ -491,7 +492,9 @@ export class LineChart
)

const blurred =
this.seriesIsBlurred(series) || point === undefined
this.hoverStateForSeries(series).background ||
this.focusArray.isInBackground(series.seriesName) ||
point === undefined

const color = blurred
? BLUR_LINE_COLOR
Expand Down Expand Up @@ -1124,8 +1127,8 @@ export class LineChart

// sort by interaction state so that hovered series
// are drawn on top of background series
if (this.isHoverModeActive) {
return sortBy(series, byInteractionState)
if (this.isHoverModeActive || this.focusArray.hasActiveSeries) {
return sortBy(series, byHoverThenFocusState)
}

return series
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import { CoreColumn, OwidTable } from "@ourworldindata/core-table"
import {
autoDetectSeriesStrategy,
autoDetectYColumnSlugs,
byInteractionState,
byHoverThenFocusState,
getDefaultFailMessage,
getInteractionStateForSeries,
Expand Down

0 comments on commit 8f83696

Please sign in to comment.