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

Adapt Visualizers to non-square/resizing canvases #282

Open
gwhitney opened this issue Apr 21, 2024 · 6 comments
Open

Adapt Visualizers to non-square/resizing canvases #282

gwhitney opened this issue Apr 21, 2024 · 6 comments
Labels
visualizer Has to do with a visualizer or the visualizer subsystem.

Comments

@gwhitney
Copy link
Collaborator

gwhitney commented Apr 21, 2024

According to @katestange in #277, the Histogram visualizer has trouble with its x-axis labels in non-square/resizing canvases.

The Grid visualizer assumes the canvas is square, and part of the display is lost if not. Should it just only work on the largest square that can fit, or is there any use for laying out numbers in a rectangular grid?

ModFill uses non-square blocks when the canvas is non-square. This may make the display a little bit harder to interpret; it's not clear it has any advantage over just always using a centered square of square blocks.

Glyph visualizer works OK, but its display is at one end of the screen and there can be signficant blank space. It should either be centered or enhanced to allow non-square rectangles of glyphs.

One potential approach for some of these cases would be to create a SquareVisualizer class that derives from P5Visualizer but creates (the largest possible) square canvas, centered in the provided div. Then visualizers that only want to work on a square could just derive from that.
See also #279 and #281.

@Vectornaut
Copy link
Collaborator

Mod Fill also responds weirdly during canvas resizing. This is because it builds the visualization progressively, considering one new element per frame.

Do either of you know whether the Mod Fill author chose progressive rendering for aesthetic reasons? If the progressive rendering is just for computational convenience, we could probably fix the resizing issue easily by doing all the rendering in one frame. On the other hand, if the progressive rendering was an aesthetic choice, we should think about how to show the animation in a way that can be resized on the fly (and maybe can be restarted without hitting "back" and re-creating the visualizer).

@katestange
Copy link
Member

As a step toward "hot modification" maybe all visualizers should be required to respond to a request to "renew", which could be a keystroke they all have to respect, or something like that, and which is also triggered upon resizing.

@gwhitney
Copy link
Collaborator Author

Do either of you know whether the Mod Fill author chose progressive rendering for aesthetic reasons?

Only Kate was around when it was merged in. But I've always assumed the time element was a way to get entry index information into the visualization.

maybe all visualizers should be required to respond to a request to "renew", which could be a keystroke they all have to respect,

A similar point has come up in the discussion in #293. It seems very likely that the VisualizerInterface will at some point soon need to have such a "renew()" call, meaning restart the drawing from the top (first index, etc., as if it was starting for the first time). But then what all triggers that action I think should remain for the Delft Team -- it's not clear whether resize should always cause this; maybe some visualizers can continue on a different-sized canvas while others need to renew. Similarly, do all parameter changes cause a renew, or just some of them? What about when the sequence changes? Should there be a "renew" button on the screen at all times? etc. etc.

@katestange
Copy link
Member

I believe the time element is valuable in Mod Fill and was intentional.

@gwhitney gwhitney added the visualizer Has to do with a visualizer or the visualizer subsystem. label Apr 23, 2024
@gwhitney
Copy link
Collaborator Author

This should be taken care of for every visualizer in their overhaul for alpha (indeed, it's one of the main reasons for the overhaul), so setting the milestone accordingly.

@gwhitney
Copy link
Collaborator Author

Mod fill seems all set on this, post #501.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
visualizer Has to do with a visualizer or the visualizer subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants