Skip to content

Draw winrate and score lead in the graph.#79

Open
CGLemon wants to merge 2 commits into
rooklift:mainfrom
CGLemon:graph-draw-winrate
Open

Draw winrate and score lead in the graph.#79
CGLemon wants to merge 2 commits into
rooklift:mainfrom
CGLemon:graph-draw-winrate

Conversation

@CGLemon

@CGLemon CGLemon commented Sep 26, 2022

Copy link
Copy Markdown
Contributor

There is the analysis winrate or score lead value on the graph. I think that it is more easy to get the best winrate if there are too many candidate moves? The value is always black's POV.

Draw winrate if we set 'Display -> Graph -> Winrate'.
Screenshot from 2022-09-26 14-59-26

Draw score lead if we 'Display -> Graph -> Score'.
Screenshot from 2022-09-26 14-59-33

@rooklift

Copy link
Copy Markdown
Owner

I doubt I'll accept this honestly, I'm trying to avoid info overload.

If you were going to do it at all, I think you can just call node.stored_winrate() and node.stored_score() from within draw_position() (and not bother worrying about the arrays). Check if the result is null though.

But I doubt I'll merge it.

@rooklift

rooklift commented Sep 26, 2022

Copy link
Copy Markdown
Owner

Also best not to draw it if the program is in a special mode (autoanalysis etc) because it will flicker in and out of existence. So I'd do it like so:

let analysis_str = "";

if (!hub.__autoanalysis && !hub.__backanalysis && !hub.__autoplay && !hub.__play_colour) {
	if (config.graph_type === 1) {
		let val = node.stored_winrate();
		if (typeof val === "number") {
			analysis_str = `(${(val * 100).toFixed(1)}%) `;
		}
	} else if (config.graph_type === 2) {
		let val = node.stored_score();
		if (typeof val === "number") {
			let s = val.toFixed(1);
			if (!s.startsWith("-")) {
				s = "+" + s;
			}
			analysis_str = "(" + s + ") ";
		}
	}
}

@CGLemon

CGLemon commented Sep 26, 2022

Copy link
Copy Markdown
Contributor Author

Already fixed the flicker issue. Does it look better?

@rooklift

Copy link
Copy Markdown
Owner

I guess so. But as I say, it's not a feature I really want, sorry.

@HackYardo

Copy link
Copy Markdown

I suggest to add axis to the curve and highlight the max and min values. If there is only a curve as is, it would be hard to know which move is important in a Go game...

@ernop

ernop commented Aug 9, 2023

Copy link
Copy Markdown

I would accept & enable this feature. The graph is very strange in that the meaning is implicit - there is no axis, no ticks, not even anything saying whether left or right represents white/black. You just have to memorize that fact, and it's inefficient.

@rooklift rooklift added the enhancement New feature or request label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants