Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Winrate Graph now shows the centipawn value as a hover annotation when you move the mouse #235

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yuzisee
Copy link

@yuzisee yuzisee commented Aug 11, 2023

Component

Winrate Graph

Implemented in this PR

When hovering the mouse inside the winrate graph, show the move token & eval value of the move you are hovering over.

  • Purpose:
    1. This makes it easier for users to pinpoint a specific move that they want to jump to, when hovering over the winrate graph with their mouse.
    2. This makes it easier to quickly scan for the specific eval value
  • Changes:
    • Adds last_hover_node as state to the Grapher in files/src/renderer/55_winrate_graph.js
    • When hovering over the winrate graph, save last_hover_node
    • During grapher.draw_everything call draw_hover_annotation to show token + eval of the last hovered node.
    • Adds is_inside_graph_canvas to check when the mouse leaves the graph canvas, at which point we clear last_hover_node so that the hover annotation is no longer drawn.

Testing

When hovering a move that has an eval:
image

When hovering a move that doesn't have an eval:
image

@rooklift
Copy link
Owner

Thanks. Nibbler isn't really maintained right now, the codebase is too complicated and really should be rewritten - so I don't promise to get to this any time very soon.

@yuzisee
Copy link
Author

yuzisee commented Aug 12, 2023

Understood. FWIW I've been running this locally for my own use, and it works well for me.

@yuzisee
Copy link
Author

yuzisee commented Aug 13, 2023

Fixed a couple rendering bugs in 27edd29 should be good to go now.

@yuzisee yuzisee changed the title Show a hover annotation when moving the mouse, so it's easier to pinpoint the exact move you want to click on Winrate Graph now shows a hover annotation when you move the mouse, so it's easier to pinpoint the exact move you want to click on Aug 13, 2023
@yuzisee yuzisee mentioned this pull request Aug 13, 2023
@yuzisee yuzisee changed the title Winrate Graph now shows a hover annotation when you move the mouse, so it's easier to pinpoint the exact move you want to click on Winrate Graph now shows a hover annotation when you move the mouse Aug 13, 2023
@yuzisee yuzisee marked this pull request as draft September 19, 2023 02:50
@yuzisee
Copy link
Author

yuzisee commented Sep 19, 2023

Converting to draft until #244 is resolved, since the hover depends on the graph data structures.

@yuzisee
Copy link
Author

yuzisee commented Sep 25, 2023

Updated to match #244


September 25, 2023:

  • Tested working
  • Screenshots updated above

@yuzisee yuzisee reopened this Sep 25, 2023
@yuzisee yuzisee marked this pull request as ready for review September 25, 2023 16:32
* Graph y-value matches centipawns graph
* Hover shows centipawns rather than winpct
@yuzisee yuzisee changed the title Winrate Graph now shows a hover annotation when you move the mouse Winrate Graph now shows the centipawn value as a hover annotation when you move the mouse Sep 25, 2023
@yuzisee yuzisee changed the title Winrate Graph now shows the centipawn value as a hover annotation when you move the mouse Winrate Graph now shows the move number as a hover annotation when you move the mouse Sep 28, 2023
@yuzisee yuzisee changed the title Winrate Graph now shows the move number as a hover annotation when you move the mouse Winrate Graph now shows the centipawn value as a hover annotation when you move the mouse Sep 29, 2023
@yuzisee yuzisee marked this pull request as draft September 29, 2023 16:41
@yuzisee
Copy link
Author

yuzisee commented Sep 29, 2023

Leaving this as a draft for now, in favor of #249 first (which is simpler).

This branch remains working in case someone wants to try it out, but otherwise I'll revisit & rebase this current pull request only if #249 is accepted into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants