Skip to content

Commit

Permalink
Graph/Legend: Include pivot variant for growthAdvantage
Browse files Browse the repository at this point in the history
The model JSONs will include GA values for the pivot variant as of
<nextstrain/forecasts-ncov#127>. Update the
Graph's xDomain and the Legend to include the pivot variants
to properly plot the pivot variant values.
  • Loading branch information
joverlee521 committed Jan 31, 2025
1 parent 4d871f9 commit 9f37f53
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function expandParams(providedParams, location) {
params.tooltipPt = categoryPointTooltip;
params.yDomain = function() {return this.modelData.get('domains').get('ga');};
params.xDomain = function() {
return ['', ...this.modelData.get('variants').filter(v => v !== this.modelData.get('pivot'))]
return ['', ...this.modelData.get('variants')]
}
params.dashedLines = [1.0]
break;
Expand Down
3 changes: 0 additions & 3 deletions src/lib/components/Legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ const useLegend = (d3Container, modelData, sizes, setLegendSwatchHovered, preset
/* legend entries are arranged via the parent container's flexbox settings */

let variants = modelData.get('variants')
if (preset==="growthAdvantage") {
variants = variants.filter((v) => v!==modelData.get('pivot'))
}

const dom = d3.select(d3Container.current);
dom.selectAll("*").remove();
Expand Down

0 comments on commit 9f37f53

Please sign in to comment.