Skip to content

Commit

Permalink
chore: bump chartjs-plugin-annotation to 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Aug 15, 2024
1 parent a5bbf98 commit a0dcfbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 8 additions & 5 deletions frontend/src/ts/test/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -155,7 +158,7 @@ async function updateGraph(): Promise<void> {
padding: 3,
borderRadius: 3,
position: "start",
enabled: true,
display: true,
content: `${content}`,
},
});
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)}`,
Expand Down

0 comments on commit a0dcfbb

Please sign in to comment.