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

Wishlist: Please add laps filter to histogram view #64

Open
idealist1508 opened this issue Mar 10, 2021 · 13 comments
Open

Wishlist: Please add laps filter to histogram view #64

idealist1508 opened this issue Mar 10, 2021 · 13 comments

Comments

@idealist1508
Copy link
Contributor

I am using ActivityLog2 to compare my trainings.
To compare laps with each other please add laps filter to histogram view:
image
What do you think? I could try to implement this and make PR.

@alex-hhh
Copy link
Owner

Yes, I would like to have this feature. Looking at the screenshot, it looks like you already implemented this? If so, can you open a pull request for this, so I have a look at the code?

@idealist1508
Copy link
Contributor Author

No, it is only "photoshop". I would try to implement it.

@alex-hhh
Copy link
Owner

I pushed some initial work towards implementing this to the ah/histogram-laps branch, https://github.com/alex-hhh/ActivityLog2/tree/ah/histogram-laps. Note that there were some corresponding changes to the data-frame package, so you will need to run a git submodule update after you checkout that branch.

This implementation is incomplete. At least the following are missing:

  • once you select a lap, there is no way to select the histogram for the entire activity
  • currently the plot X axis only shows the minimum range for the current lap, making laps difficult to compare, the Y axis (height) is also at its minimum range. It would be good to get the axis range from the histogram of the entire activity , so lap histograms are easier to compare
  • even better it would be good to plot the entire histogram in the background faded out.
  • as an implementation, this is somewhat inefficient, as it recalculates everything each time a new lap is selected -- this should be changed to only update what is needed, using "plot-state" and "plot-data" structures, as it is done in "inspect-graphs.rkt".

@idealist1508
Copy link
Contributor Author

* currently the plot X axis only shows the minimum range for the current lap

I would prefer to allow manual setting of ranges for both axes. This will make it easy to compare even different activities. I am missing this feature in a chart view too.

@idealist1508
Copy link
Contributor Author

How to debug? I set breakpoints in inspect-histogram.rkt in a function refresh-plot, but it dosn't hit. What i am doing wrong?
Do you now any tutorials?

@alex-hhh
Copy link
Owner

alex-hhh commented Mar 21, 2021

I don't use the Racket debugger myself, but you can ask for help about it on the racket-users list at https://groups.google.com/g/racket-users.

I use several techniques for debugging, and did not write all of them down, but here are some tips of what might help in this case:

  • first, I usually set-up a simpler program, with just the modules I am working on, so it loads faster. I pushed some changes to the branch, and you can see a sample program for this in the etc/scratch-histogram-laps.rkt file. You will need to replace the session ID with one from your database. This program will load faster, so you can run it repeatedly more efficiently.
  • next, in this case, I would just use printf statements , to print out values that I am interested in. This is especially useful, since ActivityLog2 uses separate threads, and I am not sure that the Racket debugger can handle them.

Hope this helps.

@idealist1508
Copy link
Contributor Author

I add a code to deselect an item with a click on it. https://github.com/idealist1508/ActivityLog2/tree/ah/histogram-laps
Please review.

alex-hhh added a commit that referenced this issue Mar 29, 2021
* The lap panels for laps and elevation graph in the map tab can now be
  resized by dragging the split line between the panels.  Same for the lap
  panel in the graphs tab, see also #66

* The laps in the graphs, map and laps pane can now be unselected by clicking
  a second time on a selected item, based on an idea from @idealist1508, see
  #64 (comment)
@alex-hhh
Copy link
Owner

Thanks for the suggestion for unclicking items -- I ended up using a slightly different approach which does not make use of a timer% object and also unselects the selected highlight from the map and graphs view. I merged these changes to the master branch, you can check them out.

@idealist1508
Copy link
Contributor Author

This solution has one bug. Double click doesn't work on selected items.

@idealist1508
Copy link
Contributor Author

I found that under linux in a single mode it was possible to deselect an item by a ctrl click. I don't know if this works on Windows too.

@alex-hhh
Copy link
Owner

alex-hhh commented Apr 5, 2021

Double click works fine on Windows with these changes, and I am not sure how it would stop working in Linux, since the "double click" is a different message....

@idealist1508
Copy link
Contributor Author

Maybe my description was not optimal, so I made a video.
dblclick
My second comment was, that I found how to deselect an Item when list is in a single mode.
singlemode
If it works on other platforms then a workaround with the multiselect isn't needed.

alex-hhh added a commit that referenced this issue Apr 7, 2021
Partial revert of 30b6855, since this does
not work on Linux, see
#64 (comment)

Kept the rest of the un-select mechanism in place, in the hope that this
functionality can be implemented in a portable way in the qresults-list%
widget.
@alex-hhh
Copy link
Owner

alex-hhh commented Apr 8, 2021

Thanks for explaining this -- un-select is not supported on Windows, but I just reverted this change as it is probably best not to modify the native widget behavior as it is not portable *racket/gui uses the native widget on each platform whenever possible).

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

2 participants