chore: bump chartjs-plugin-annotation to 2.2.1

This commit is contained in:
Miodec 2024-08-15 11:08:32 +02:00
parent a5bbf9856f
commit a0dcfbb6f5
2 changed files with 9 additions and 6 deletions

View file

@ -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",

View file

@ -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<void> {
padding: 3,
borderRadius: 3,
position: "start",
enabled: true,
display: true,
content: `${content}`,
},
});
@ -208,8 +211,8 @@ export async function updateGraphPBLine(): Promise<void> {
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<void> {
);
$("#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<void> {
borderRadius: 3,
position: annotationSide,
xAdjust: labelAdjust,
enabled: true,
display: true,
content: `${tag.display} PB: ${Numbers.roundTo2(
typingSpeedUnit.fromWpm(tpb)
).toFixed(2)}`,