numberscope / frontscope

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

Add square visualizer class #247

Closed liammulh closed 1 week ago

liammulh commented 1 year ago

In the January 17, 2023 developer meeting, we discussed whether we ought to make the main visualizer canvas rectangular or square.

@katestange thought it should be rectangular (as big as we can make it with our planned UI changes where we'd have the "control panel" on the left side of the screen and the "thumbnails/bundles" on the right side). The idea is that individual visualizers can use a square portion of the rectangular canvas if they want to. @gwhitney and I agreed with this decision.

The question then became: "How do we make it so that square visualizers don't have to repeat code to enable use of a square portion of the canvas?" @gwhitney suggested for square visualizers we set the origin to be the center rather than the upper left corner of the canvas, which is the default for p5. Then we could take the min of the width and the height to be the bounds for the portion of the canvas we want to draw on. This seems like a reasonable approach that wouldn't require us to fiddle with styling.

gwhitney commented 3 months ago

We should determine based on the collection of visualizer overhauls for alpha whether this will actually be useful, and if so, implement it as part of those overhauls. Or drop this proposal altogether. But setting the milestone since we should resolve this.

gwhitney commented 1 week ago

Actually, it seems to me that the only thing one needs to do for a "Square" visualizer class is just implement the requestedAspectRatio() method to return 1. So there is nothing left to do here. Closing.