jkboyce / jugglinglab

Juggling Lab juggling animator
https://jugglinglab.org
GNU General Public License v2.0
86 stars 17 forks source link

Feature suggestion: Display siteswap throw numbers in visualiser #101

Open hapiel opened 2 years ago

hapiel commented 2 years ago

It would be cool to be able to display the siteswap in the visualiser. The number could be marked next to each point in the ladder, and perhaps the number could be marked next to the ball in flight after it is thrown.

Here is a mockup of what that could look like:

afbeelding

jkboyce commented 2 years ago

I've been thinking about this one. The ladder diagram needs to be generated entirely from the JML version of the pattern, so the annotations would have to be embedded in the JML. Adding an attribute to <event> would be the obvious way. Something like:

<event x="12" y="0" z="0" t="0" hand="1:right" text="3">

Then when the siteswap component is generating JML it would add on the annotations. JML-embedded annotations would also be easy to render next to the props in flight. Neat idea!

For the ladder diagram, one concern is that space can be limited when there are multiple jugglers. Here is what it looks like with 8 (the max number):

Screen Shot 2022-01-25 at 3 27 48 PM

Some of the annotations could be four or more characters long, e.g. multiplex throws. Practically speaking we'd have to hide the annotations when there isn't enough space. The user can drag the ladder portion of the window wider.

Another UI question is how to allow the user to show/hide the annotations. Not everyone will want throw values on the balls all of the time. The straightforward thing would be to make it a setting in animation preferences, although this is not quick to toggle. Or it could be a menu item under View.

hapiel commented 2 years ago

UI show hide: The most logical with the current setup seems to be 'animation preferences' for me. This is indeed not quick, but that's perhaps something to consider in a larger UI redesign. I think it will be more than fine for now.

As for the ladder diagrams: On my 1680px wide display there is still of space left, but with multiplexes it could get messy, yes. afbeelding

One idea that comes to mind is to only show the leftmost ladder with siteswaps if there is not enough space, unless the user hovers over another ladder in which case the annotation turns on there. But this might not be practical. However, it is hopefully only needed in edge cases (both many jugglers and annotations turned on).

Another issue that is not mentioned yet: The user can change the pattern with the visual ladder editor in such a way that it is no longer the original siteswap. Some suggested fixes for that are: Remove all annotation as soon as one node passes another, or try and deduce the siteswap from the JML instead of embedding it into it...