Skip to content

Commit

Permalink
fix(frontend): y-axis REF variables (#620)
Browse files Browse the repository at this point in the history
When a plot is a reference plot, the variable name is displayed as `REF` on the y-axis. This fixes that by trimming the `REF ` prefix from y-axis plot names before finding the variable name.
  • Loading branch information
eatyourgreens authored Dec 13, 2024
1 parent 409b21d commit 2b0c561
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend-v2/src/features/simulation/SimulationPlotView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ const SimulationPlotView: FC<SimulationPlotProps> = ({

const yAxisVariables = plotData
.filter((d) => !d.yaxis)
.map((d) => d.name?.split(" ")[0]);
.map((d) => d.name?.replace("REF ", "").split(" ")[0]);
const y2AxisVariables = plotData
.filter((d) => d.yaxis)
.map((d) => d.name?.split(" ")[0]);
.map((d) => d.name?.replace("REF ", "").split(" ")[0]);
let yAxisTitle = [...new Set(yAxisVariables)].join(", ");
let y2AxisTitle = [...new Set(y2AxisVariables)].join(", ");
let xAxisTitle = "Time";
Expand Down

0 comments on commit 2b0c561

Please sign in to comment.