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

Zoom rectangle for rectangular diagrams #305

Closed
georgtree opened this issue Aug 31, 2023 · 14 comments
Closed

Zoom rectangle for rectangular diagrams #305

georgtree opened this issue Aug 31, 2023 · 14 comments
Assignees
Milestone

Comments

@georgtree
Copy link

Hello!
I would like to see the rectangle selection tool for graphs, because now for transient simulation you have to go to properties of particular graph and set x and y limits manually, it it possible to add this feature in future?

@zergud zergud self-assigned this Aug 31, 2023
@zergud zergud added this to the 23.1.0 milestone Oct 23, 2023
@medwatt
Copy link

medwatt commented Nov 12, 2023

Also, a vertical/horizontal cursor will be great.

@zergud zergud modified the milestones: 24.1.0, 24.2.0 Jan 19, 2024
@iwbnwif
Copy link
Contributor

iwbnwif commented Jan 19, 2024

This feature would also be useful for tuning so you can home into a specific point on the Smith chart. It would be best if the marker font remained the same and didn't zoom with the chart.

@iwbnwif
Copy link
Contributor

iwbnwif commented Jan 21, 2024

I've had a quick go at implementing this by setting the existing limits via a mouse action. So far, only rectangular diagrams are supported and other plots are undefined. I would like to a bit of refactoring to simplify the implementation of this, in particular to use QTransform to map between various coordinate systems.

This is what it looks like:
Screencast from 21-01-24 20:25:05.webm

Initial code is here: https://github.com/iwbnwif/qucs_s/tree/graph_limits_by_mouse

@zergud
Copy link
Collaborator

zergud commented Jan 21, 2024

looks amazing!
exactly as needed for the RectangularDiagram
create PR when you're ready

p.s. zoom for other type of diagram in next step

@zergud zergud changed the title Zoom rectangle for plots Zoom rectangle for rectangular diagrams Jan 21, 2024
@zergud zergud modified the milestones: 24.2.0, 24.1.0 Jan 21, 2024
@iwbnwif
Copy link
Contributor

iwbnwif commented Jan 22, 2024

Thank you. There are two main problems at the moment that I would like to fix before submitting a PR:

  1. Dragging the mouse to zoom over a diagram with lots of data points is slow. I suspect that the chart is being redrawn on mouse moves, so I will need to look into this.
  2. The step sizes are arbitrary (basically a simple subdivision of the new limits) which results in some wild values on the axis.

As mentioned above, I would like to discuss about refactoring some of the diagram code to make transforms between coordinate systems simpler. This will pave the way for cursors and mouse dragging of markers. Anyway, we can discuss that on a separate issue when the time comes.

Unfortunately, I am still a real noob when it comes to git. I hope that the commits are clean, but I have had a bit of trouble merging some recent commits in master to my 'graph_limits_by_mouse' branch :(

@ra3xdh
Copy link
Owner

ra3xdh commented Jan 23, 2024

The proposed feature implemented by #485. Closing as completed. It still be unclear how to zoom Smith and Polar charts by mouse selection.

@ra3xdh ra3xdh closed this as completed Jan 23, 2024
@zergud zergud reopened this Jan 23, 2024
@zergud
Copy link
Collaborator

zergud commented Jan 23, 2024

need to implement separate zoom for two Y-axes

@iwbnwif
Copy link
Contributor

iwbnwif commented Jan 23, 2024

need to implement separate zoom for two Y-axes

I am not sure how to do this. I suppose we could use a keyboard key (e.g., Ctrl or Alt) for the selection, but which X-axes value will take priority?

@zergud
Copy link
Collaborator

zergud commented Jan 23, 2024

Why?
Can we rrpeat the same things for for second y-axis?
Min max step differs

@iwbnwif
Copy link
Contributor

iwbnwif commented Jan 23, 2024

Do you mean scale both axes by the same amount? If so, yes that should be simple to implement.

@zergud
Copy link
Collaborator

zergud commented Jan 23, 2024

I will offer my solution in PR, if you don’t mind

@iwbnwif
Copy link
Contributor

iwbnwif commented Jan 23, 2024

I will offer my solution in PR, if you don’t mind

Of course not!

@zergud
Copy link
Collaborator

zergud commented Jan 23, 2024

please check branch 305-zoom-both-axes

  1. fix right button
  2. independed scale for Yleft YRight
  3. recalculate step

@iwbnwif
Copy link
Contributor

iwbnwif commented Jan 23, 2024

Thank you, that looks great!

@zergud zergud closed this as completed Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants