Hit testing for axes · Issue #1419 · oxyplot/oxyplot · GitHub
Skip to content

Hit testing for axes #1419

Open
Open

Description

@objorke

Add support for hit-testing on axes

Activity

  1. objorke commented on Nov 3, 2019

    @objorke
    MemberAuthor

    See #1415

  2. objorke commented on Nov 3, 2019

    @objorke
    MemberAuthor

    @silviubogan You have implemented this in your fork, can you create a PR for this change only?

    https://github.com/oxyplot/oxyplot/pull/1415/files#diff-2c8edecb3bf6753459205e53722c4c22R1758

  3. silviubogan commented on Nov 4, 2019

    @silviubogan

    @objorke I think it works (I just copied and pasted existing code) although I did not test the code, a reason for this is that I do not know for what hit testing for axes will be used excepting tooltips. Please let me know if you agree with the creation of the pull request based on the commit from the link above. Thank you.

  4. objorke commented on Nov 5, 2019

    @objorke
    MemberAuthor

    I would prefer if the hit testing code was in the Axis class, and not the PlotModel, similar to the Series and Annotations. I think the GetAxesFromPoint has slightly different usage (it is used for zoom and pan handlers I think) where it also needs to find axes when clicking inside the "plot area". I would prefer not adding the overload on GetAxesFromPoint.

    Yes, tooltips is probably the first need for hit testing on axes, but I think it can also be useful if you have a user interface where you can click on an axis to select it and edit min/max values.

  5. silviubogan commented on Nov 6, 2019

    @silviubogan

    @objorke I think I have remade it in the way you suggested. There is just one commit. I have also tested it with this example. Please let me know if I can make the PR (I will include the example in the PR only if you suggest this). Thank you.

  6. objorke commented on Nov 6, 2019

    @objorke
    MemberAuthor

    Can you create a branch and include both the example and the changes?

    Do we need to add all the position tier logic in the hit test code? can the axis simply keep a bounds rectangle (that it updates during rendering) that we can check against?
    I think the hit test code could be something like "return this.axisBounds is not empty && this.axisBounds
    contains args.Point"

  7. silviubogan commented on Nov 7, 2019

    @silviubogan

    @objorke

    Can you create a branch and include both the example and the changes?

    Yes.

    Do we need to add all the position tier logic in the hit test code?

    No.

    can the axis simply keep a bounds rectangle (that it updates during rendering) that we can check against?
    I think the hit test code could be something like "return this.axisBounds is not empty && this.axisBounds
    contains args.Point"

    I think that it is possible. I have started working on what you requested. I have made a commit with the example from the gist in the same branch as the one in my previous message.

    Thank you.

  8. 23W commented on May 14, 2023

    @23W

    @objorke I think I have remade it in the way you suggested. There is just one commit. I have also tested it with this example. Please let me know if I can make the PR (I will include the example in the PR only if you suggest this). Thank you.

    Nice change, will we see it merged to OXYPlot?

  9. VisualMelon commented on May 14, 2023

    @VisualMelon
    Contributor

    Could be something to incorporate into #1966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions