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

Grapher zoom out bugfix #349

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

stefanhahmann
Copy link
Collaborator

This PR contains a fix for this bug description (cf. #212):

I think there is indeed some bug. After opening a new grapher window, selecting "Spot - X", "Spot - Y", "From context: full graph" and clicking "Plot", the plot window is updated. But it zooms to a location without data points. Giving the impression that there is no data available. The way to zoom out is to first click on the plot and afterwards use Shift+Crtl+Scroll or Z + Z to zoom out. I myself couldn't find how to zoom out, despite knowing the short cuts. So I too got the impression, that the grapher window is buggy. After I successfully zoomed out once, everything worked really nicely. So there seems to be a problem only with the initial state after opening a new grapher window.

  • The reason for the bug was: there was fixed timeout before the zoom out to max extent would start after the data had been painted with the current axis settings. In case of changing the axes, it could however (with large datasets) happen that graphchanged() + layout() was not completey finished, before the zoom out was started. In these cases the zoom out would still zoom out to the extent of the previous axes, which leaded to unexpected behaviour. This commit introduces a process that lets the zooming out wait, until the graph was layouted during the paint process once (and by this the max extent was updated).

This PR furthermore introduces a change to the defaults of the Grapher Windows:

  • Initialize the grapher windows with full graph context and non-connected mode

    • Reasoning: It is difficult to judge, what is the most often used combination of settings and thus, which should be the default settings for the grapher. For the case of analysing single tracks the item source "track of selection" makes most sense. Also in this case drawing the edges in the grapher between these points makes sense. In other cases, such when inspecting large selections or even the dataset as a whole, showing the edges does not really help and leads to a very confusing plot. For the case of inspecting the full dataset without any selection the setting "track of selection", leads to an empty plot, when the grapher is first show. Thus, with this commit, the defaults are changed to full graph context and non-connected.

…ted mode

* Reasoning: It is difficult to judge, what is the most often used combination of settings and thus, which should be the default settings for the grapher. For the case of analysing single tracks the item source "track of selection" makes most sense. Also in this case drawing the edges in the grapher between these points makes sense. In other cases, such when inspecting large selections or even the dataset as a whole, showing the edges does not really help and leads to a very confusing plot. For the case of inspecting the full dataset without any selection the setting "track of selection", leads to an empty plot, when the grapher is first show. Thus, with this commit, the defaults are changed to full graph context and non-connected.
… graph changed was called

* Reasoning: before, there was fixed timeout. However, with large datasets, it could have happened that graphchanged() + layout() was not completey performed before zoom out was started leading to unexpected behaviour. This commit introduces a process that lets the zooming out wait until the graph was layouted once according to the current data.
@stefanhahmann stefanhahmann self-assigned this Nov 12, 2024
@stefanhahmann stefanhahmann changed the base branch from master to dev November 12, 2024 09:53
@tinevez tinevez merged commit eea86f2 into mastodon-sc:dev Nov 12, 2024
1 check passed
@stefanhahmann stefanhahmann deleted the grapher-zoom-out-bugfix branch November 12, 2024 11:07
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

Successfully merging this pull request may close these issues.

2 participants