mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-07 11:30:24 +08:00
changed trend slope to wpm change per hour
This commit is contained in:
parent
a2fab6f7a8
commit
47162ffa4b
1 changed files with 12 additions and 4 deletions
|
|
@ -1013,6 +1013,8 @@ function loadMoreLines() {
|
|||
}
|
||||
}
|
||||
|
||||
let totalSecondsFiltered = 0;
|
||||
|
||||
function refreshAccountPage() {
|
||||
function cont() {
|
||||
refreshThemeColorObject();
|
||||
|
|
@ -1041,7 +1043,7 @@ function refreshAccountPage() {
|
|||
};
|
||||
|
||||
let totalSeconds = 0;
|
||||
let totalSecondsFiltered = 0;
|
||||
totalSecondsFiltered = 0;
|
||||
|
||||
let totalCons = 0;
|
||||
let totalCons10 = 0;
|
||||
|
|
@ -1374,11 +1376,17 @@ function refreshAccountPage() {
|
|||
|
||||
let trend = findLineByLeastSquares(wpmPoints);
|
||||
|
||||
let slope = calculateSlope(trend);
|
||||
let plus = slope > 0 ? "+" : "";
|
||||
let wpmChange = trend[1][1] - trend[0][1];
|
||||
|
||||
let wpmChangePerHour = wpmChange * (3600 / totalSecondsFiltered);
|
||||
|
||||
// let slope = calculateSlope(trend);
|
||||
let plus = wpmChangePerHour > 0 ? "+" : "";
|
||||
|
||||
$(".pageAccount .group.chart .below").text(
|
||||
`Trend slope: ${plus + roundTo2(slope)}`
|
||||
`Speed change per hour spent typing: ${
|
||||
plus + roundTo2(wpmChangePerHour)
|
||||
} wpm.`
|
||||
);
|
||||
|
||||
resultHistoryChart.update({ duration: 0 });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue