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

egui_plot features to enable region-oriented use cases #19

Open
sowbug opened this issue Mar 1, 2024 · 0 comments
Open

egui_plot features to enable region-oriented use cases #19

sowbug opened this issue Mar 1, 2024 · 0 comments

Comments

@sowbug
Copy link

sowbug commented Mar 1, 2024

I'm working on an application containing a musical pattern editor, which is basically a grid divided into musical notes on the Y axis (imagine a sideways piano keyboard), and a period of time, representing a single musical measure, divided into 16 or 32 sections on the X axis. Each division would have a horizontal or vertical line, forming a visible grid. Users would click the boxes in the grid to create or delete notes. This is very close to an appropriate use case for egui_plot, with at least these exceptions:

  1. The grid-marker labels on the axes belong to the boxes (regions), not the lines (points). Instead of drawing a marker center-aligned with the grid lines, they'd be in between adjacent lines. I could imagine a new attribute of Plot that treats the spaces rather than dividers as the labeled entities.
  2. The overall area of the grid has a finite bound; for example, it might be 88 notes vertically (pianos have 88 keys), and 16 notes horizontally (for a typical 4/4 time signature with each of four beats divided into 4 subdivisions). There would be no reason to allow the user to zoom wider than 88 x 16 in this example. I have experimented with set_plot_bounds() inside plot.show() to clamp it to the desired bounds, but it's super-janky. I would add a new optional Plot attribute that specifies a maximum area, and enforce it properly in the egui_plot code, rather than expecting the app to do it manually. (This might also mitigate the impact of issues like Zooming out crashes egui_plot egui#3656, Panic when zooming out a plot too far egui#3462, and Applicaiton hangs when zooming all the way out on a plot egui#970.)

There might be more changes, but this is what my research has shown so far.

Is there interest in these enhancements? I might be able to give them a try.

@sowbug sowbug changed the title egui_plot features to enable new use cases egui_plot features to enable region-oriented use cases Mar 1, 2024
@emilk emilk transferred this issue from emilk/egui Jul 15, 2024
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

No branches or pull requests

1 participant