mirror of
https://github.com/ankitects/anki.git
synced 2026-01-09 03:53:55 -05:00
cheesecake method
This commit is contained in:
parent
3d0a408a2b
commit
c2fdf474dd
2 changed files with 6 additions and 3 deletions
|
|
@ -292,7 +292,8 @@ impl Collection {
|
|||
Ok((
|
||||
dr,
|
||||
(
|
||||
*result.memorized_cnt_per_day.last().unwrap_or(&0.),
|
||||
*result.memorized_cnt_per_day.last().unwrap_or(&0.)
|
||||
- *result.memorized_cnt_per_day.first().unwrap_or(&0.),
|
||||
result.cost_per_day.iter().sum::<f32>(),
|
||||
result.review_cnt_per_day.iter().sum::<usize>() as u32
|
||||
+ result.learn_cnt_per_day.iter().sum::<usize>() as u32,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import {
|
|||
bisector,
|
||||
line,
|
||||
max,
|
||||
min,
|
||||
pointer,
|
||||
rollup,
|
||||
scaleLinear,
|
||||
|
|
@ -62,7 +63,7 @@ export function renderWorkloadChart(
|
|||
.range([bounds.marginLeft, bounds.width - bounds.marginRight]);
|
||||
|
||||
const subgraph_data = ({
|
||||
[SimulateWorkloadSubgraph.ratio]: data.map(d => ({ ...d, y: d.timeCost / d.memorized })),
|
||||
[SimulateWorkloadSubgraph.ratio]: data.map(d => ({ ...d, y: d.memorized / d.timeCost })),
|
||||
[SimulateWorkloadSubgraph.time]: data.map(d => ({ ...d, y: d.timeCost / d.learnSpan })),
|
||||
[SimulateWorkloadSubgraph.count]: data.map(d => ({ ...d, y: d.count / d.learnSpan })),
|
||||
[SimulateWorkloadSubgraph.memorized]: data.map(d => ({ ...d, y: d.memorized })),
|
||||
|
|
@ -215,9 +216,10 @@ function _renderSimulationChart<T extends { x: any; y: any; label: number }>(
|
|||
// y scale
|
||||
|
||||
const yMax = max(subgraph_data, d => d.y)!;
|
||||
const yMin = min(subgraph_data, d => d.y)!;
|
||||
const y = scaleLinear()
|
||||
.range([bounds.height - bounds.marginBottom, bounds.marginTop])
|
||||
.domain([0, yMax])
|
||||
.domain([yMin, yMax])
|
||||
.nice();
|
||||
svg.select<SVGGElement>(".y-ticks")
|
||||
.call((selection) =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue