diff --git a/components/LevelThermometer.js b/components/LevelThermometer.js index c570a777..6fd26c6d 100644 --- a/components/LevelThermometer.js +++ b/components/LevelThermometer.js @@ -1,7 +1,7 @@ // @flow import * as d3 from 'd3' -import { pointsToLevels, categoryPointsFromMilestoneMap, categoryColorScale, categoryIds } from '../constants' +import { pointsToLevels, categoryPointsFromMilestoneMap, categoryColorScale, categoryIds, maxLevel } from '../constants' import React from 'react' import type { MilestoneMap } from '../constants' @@ -29,7 +29,7 @@ class LevelThermometer extends React.Component { super(props) this.pointScale = d3.scaleLinear() - .domain([0, 135]) + .domain([0, maxLevel]) .rangeRound([0, width - margins.left - margins.right]); this.topAxisFn = d3.axisTop() diff --git a/components/PointSummaries.js b/components/PointSummaries.js index 7eaf9e66..61934b57 100644 --- a/components/PointSummaries.js +++ b/components/PointSummaries.js @@ -1,6 +1,6 @@ // @flow -import { pointsToLevels, milestoneToPoints, trackIds, totalPointsFromMilestoneMap } from '../constants' +import { pointsToLevels, milestoneToPoints, trackIds, totalPointsFromMilestoneMap, maxLevel } from '../constants' import type { MilestoneMap } from '../constants' import React from 'react' @@ -22,7 +22,7 @@ class PointSummaries extends React.Component { let pointsToNextLevel = 1 while (!(nextLevel = pointsToLevels[totalPoints + pointsToNextLevel])) { pointsToNextLevel++ - if (pointsToNextLevel > 135) { + if (pointsToNextLevel > maxLevel) { pointsToNextLevel = 'N/A' break }