Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/LevelThermometer.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -29,7 +29,7 @@ class LevelThermometer extends React.Component<Props> {
super(props)

this.pointScale = d3.scaleLinear()
.domain([0, 135])
.domain([0, maxLevel])
.rangeRound([0, width - margins.left - margins.right]);

this.topAxisFn = d3.axisTop()
Expand Down
4 changes: 2 additions & 2 deletions components/PointSummaries.js
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -22,7 +22,7 @@ class PointSummaries extends React.Component<Props> {
let pointsToNextLevel = 1
while (!(nextLevel = pointsToLevels[totalPoints + pointsToNextLevel])) {
pointsToNextLevel++
if (pointsToNextLevel > 135) {
if (pointsToNextLevel > maxLevel) {
pointsToNextLevel = 'N/A'
break
}
Expand Down