mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 17:26:36 -04:00
Fix: Simulator/workload transition
This commit is contained in:
parent
b6f551210d
commit
3ebe45aa65
1 changed files with 25 additions and 8 deletions
|
@ -161,6 +161,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
} finally {
|
} finally {
|
||||||
simulating = false;
|
simulating = false;
|
||||||
if (resp) {
|
if (resp) {
|
||||||
|
// Clear the graph if transitioning from workload to simulation
|
||||||
|
if (workload == true) {
|
||||||
|
points = [];
|
||||||
|
simulationNumber = 0;
|
||||||
|
}
|
||||||
|
workload = false;
|
||||||
|
|
||||||
simulationNumber += 1;
|
simulationNumber += 1;
|
||||||
const dailyTotalCount = addArrays(
|
const dailyTotalCount = addArrays(
|
||||||
resp.dailyReviewCount,
|
resp.dailyReviewCount,
|
||||||
|
@ -203,15 +210,25 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
} finally {
|
} finally {
|
||||||
simulating = false;
|
simulating = false;
|
||||||
if (resp) {
|
if (resp) {
|
||||||
points = Object.entries(resp.memorized).map(([dr, v]) => ({
|
// Clear the graph if transitioning from simulation to workload
|
||||||
x: parseInt(dr),
|
if (workload == false) {
|
||||||
timeCost: resp!.cost[dr],
|
points = [];
|
||||||
memorized: v,
|
simulationNumber = 0;
|
||||||
count: -1,
|
}
|
||||||
label: 1,
|
|
||||||
}));
|
|
||||||
|
|
||||||
workload = true;
|
workload = true;
|
||||||
|
|
||||||
|
simulationNumber += 1;
|
||||||
|
|
||||||
|
points = points.concat(
|
||||||
|
Object.entries(resp.memorized).map(([dr, v]) => ({
|
||||||
|
x: parseInt(dr),
|
||||||
|
timeCost: resp!.cost[dr],
|
||||||
|
memorized: v,
|
||||||
|
count: -1,
|
||||||
|
label: simulationNumber,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
|
||||||
tableData = renderWorkloadChart(
|
tableData = renderWorkloadChart(
|
||||||
svg as SVGElement,
|
svg as SVGElement,
|
||||||
bounds,
|
bounds,
|
||||||
|
|
Loading…
Reference in a new issue