numberscope / frontscope

Numberscope's front end and user interface: responsible for specifying sequences and defining and displaying visualizers
MIT License
7 stars 14 forks source link

Add NumberGlyphs toggleable pop-up legend/labels #302

Open katestange opened 2 months ago

katestange commented 2 months ago

When NumberGlyphs was merged (#231), we decided to remove the keyboard interactions entirely. These were supposed to be:

(1) upon a keypress, toggle showing the colour legend across the bottom of the canvas (2) upon a different keypress, toggle showing text labels over the discs

The original attempt at coding this is buried in the git history of that PR, but the problem was that it required redrawing the glyphs at each keypress, and this took time, which meant you could press/toggle repeatedly while the glyphs were in progress, resulting in some of them being drawn overtop of the legend, for example.

This issue is to create a nice toggle effect for overlays, restoring this functionality.

gwhitney commented 2 months ago

A related question is whether the visualizer should reserve space for the legend in the first place. Conceivably, it could even see whether its canvas is portrait or landscape and put legend below or to the right of the display accordingly, keeping it out of the glyph display area altogether. Of course, if NumberGlyphs is enhanced to allow rectangular layouts of glyphs, then the orientation of the canvas will be moot, and it will just be a matter of where to put the legend and whether or not it should overlap the glyphs.