diff --git a/evolve_analytics.meta.js b/evolve_analytics.meta.js index 2e40e28..0942ede 100644 --- a/evolve_analytics.meta.js +++ b/evolve_analytics.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Evolve Analytics // @namespace http://tampermonkey.net/ -// @version 0.10.4 +// @version 0.10.5 // @description Track and see detailed information about your runs // @author Sneed // @match https://pmotschmann.github.io/Evolve/ diff --git a/src/ui/graph.ts b/src/ui/graph.ts index 203a711..99afedc 100644 --- a/src/ui/graph.ts +++ b/src/ui/graph.ts @@ -80,7 +80,11 @@ function* timestamps(plotPoints: PlotPoint[], key: "day" | "segment") { }); } -function* statsMarks(runs: HistoryEntry[], bestRun: HistoryEntry) { +function* statsMarks(runs: HistoryEntry[], bestRun: HistoryEntry | undefined) { + if (bestRun === undefined) { + return; + } + const bestIdx = runs.indexOf(bestRun); yield Plot.axisX([bestIdx], { tickFormat: () => "PB", @@ -295,7 +299,7 @@ export function makeGraph(history: HistoryManager, view: View, currentRun: Lates marks.push(...lollipopMarks(plotPoints, false, filteredRuns.length)); marks.push(...timestamps(plotPoints, "day")); marks.push(...rectPointerMarks(plotPoints, filteredRuns, "dayDiff", "day")); - marks.push(...statsMarks(filteredRuns, bestRun!)); + marks.push(...statsMarks(filteredRuns, bestRun)); break; case "duration": @@ -318,7 +322,7 @@ export function makeGraph(history: HistoryManager, view: View, currentRun: Lates marks.push(...lineMarks(plotPoints, filteredRuns, "day", view.smoothness)); marks.push(...timestamps(plotPoints, "day")); - marks.push(...statsMarks(filteredRuns, bestRun!)); + marks.push(...statsMarks(filteredRuns, bestRun)); break; case "duration":