Skip to content

Commit

Permalink
Render a faint gray area around the eval line based on the likelyness of
Browse files Browse the repository at this point in the history
a decisive result according to WDL

* When eval is close to zero, this allows users to more easily identify
  which "drawn" positions are actually dead drawn vs.
  unclear/complex/sharp
* When eval favors one side, this allows users to more easily identify
  which portions of the game contained more counterplay/complexity
  despite the advantage
  • Loading branch information
yuzisee committed Sep 28, 2023
1 parent 09e91bb commit 75c9c80
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions files/src/renderer/55_winrate_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function NewGrapher() {

let runs = this.make_runs(eval_list, width, height, node.graph_length_knower.val);

graphctx.fillStyle = 'rgba(255, 255, 255, 0.25)';

// Draw our normal runs...

graphctx.strokeStyle = "white";
Expand All @@ -47,6 +49,26 @@ function NewGrapher() {
graphctx.setLineDash([]);

for (let run of runs.normal_runs) {
// Drawishness fill
let drawishness_fill = new Path2D();
if (run[0].y_shaded1 !== null) {
drawishness_fill.moveTo(run[0].x1, run[0].y1 + run[0].y_shaded1);
for (let edge of run) {
if (edge.y_shaded2 !== null) {
drawishness_fill.lineTo(edge.x2, edge.y2 + edge.y_shaded2);
}
}
}
if (run[run.length - 1].y_shaded2 !== null) {
drawishness_fill.lineTo(run[run.length - 1].x2, run[run.length - 1].y2 + run[run.length - 1].y_shaded2);
for (let edge of run.reverse()) {
if (edge.y_shaded1 !== null) {
drawishness_fill.lineTo(edge.x1, edge.y1 - edge.y_shaded1);
}
}
}
graphctx.fill(drawishness_fill);

// Evaluation line
graphctx.beginPath();
graphctx.moveTo(run[0].x1, run[0].y1);
Expand Down

0 comments on commit 75c9c80

Please sign in to comment.