diff --git a/frontend/package.json b/frontend/package.json index b90b6b158c8c..5c178a4eafe3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -76,7 +76,7 @@ "canvas-confetti": "1.5.1", "chart.js": "3.7.1", "chartjs-adapter-date-fns": "3.0.0", - "chartjs-plugin-annotation": "1.4.0", + "chartjs-plugin-annotation": "2.2.1", "chartjs-plugin-trendline": "1.0.2", "color-blend": "4.0.0", "damerau-levenshtein": "1.0.8", diff --git a/frontend/src/ts/test/result.ts b/frontend/src/ts/test/result.ts index c6f6ea649049..6c88bad9620f 100644 --- a/frontend/src/ts/test/result.ts +++ b/frontend/src/ts/test/result.ts @@ -34,7 +34,10 @@ import * as Funbox from "./funbox/funbox"; import Format from "../utils/format"; import confetti from "canvas-confetti"; -import type { AnnotationOptions } from "chartjs-plugin-annotation"; +import type { + AnnotationOptions, + LabelPosition, +} from "chartjs-plugin-annotation"; import Ape from "../ape"; import { Result } from "@monkeytype/shared-types"; import { Mode } from "@monkeytype/contracts/schemas/shared"; @@ -155,7 +158,7 @@ async function updateGraph(): Promise { padding: 3, borderRadius: 3, position: "start", - enabled: true, + display: true, content: `${content}`, }, }); @@ -208,8 +211,8 @@ export async function updateGraphPBLine(): Promise { padding: 3, borderRadius: 3, position: "center", - enabled: true, content: `PB: ${chartlpb}`, + display: true, }, }); const lpbRange = typingSpeedUnit.fromWpm(20); @@ -563,7 +566,7 @@ async function updateTags(dontSave: boolean): Promise { ); $("#result .stats .tags .editTagsButton").addClass("invisible"); - let annotationSide = "start"; + let annotationSide: LabelPosition = "start"; let labelAdjust = 15; activeTags.forEach(async (tag) => { const tpb = await DB.getLocalTagPB( @@ -634,7 +637,7 @@ async function updateTags(dontSave: boolean): Promise { borderRadius: 3, position: annotationSide, xAdjust: labelAdjust, - enabled: true, + display: true, content: `${tag.display} PB: ${Numbers.roundTo2( typingSpeedUnit.fromWpm(tpb) ).toFixed(2)}`,