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

Interaction functions #10046

Merged
merged 14 commits into from Mar 24, 2022
Merged

Interaction functions #10046

merged 14 commits into from Mar 24, 2022

Commits on Jan 4, 2022

  1. Refactor get...Items functions to take events rather than positions

    To work toward exposing something like the get...Items functions.
    joshkel committed Jan 4, 2022
    Copy the full SHA
    9c098a9 View commit details
    Browse the repository at this point in the history
  2. Switch getAxisItems to use optimizedEvaluateItems

    optimizedEvaluateItems falls back to evaluating all items for unsorted items, and sorting / optimizing ought to be okay, so this ought to be equivalent.
    joshkel committed Jan 4, 2022
    Copy the full SHA
    43769cb View commit details
    Browse the repository at this point in the history
  3. Performance

    joshkel committed Jan 4, 2022
    Copy the full SHA
    7022cda View commit details
    Browse the repository at this point in the history
  4. Consolidate getRelativePosition

    helpers.dom.js's getRelativePosition already had logic to handle ChartEvent vs. Event (as demonstrated by the `native` check within `getCanvasPosition`), so it's redundant for core.interaction.js to have its own `native` check.
    
    Update `getRelativePosition` to use the same `native` check as core.interaction.js's version.  As best as I can tell, the ChartEvent's x and y are populated from `getRelativePosition`, so the previous `getCanvasPosition` was effectively just duplicating `getRelativePosition'`s work.  I added a test to verify this; it depends on a local, not-yet-submitted change in chartjs-test-utils' `triggerMouseEvent` to return the mouse event that it triggers.
    joshkel committed Jan 4, 2022
    Copy the full SHA
    062e61a View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    c765938 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    d71d406 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    9782e7e View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    121167d View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2022

  1. Code review feedback

    Add a non-null assertion, as requested in code review.
    
    Add JSDoc to clarify that `getCanvasPosition` now expects a native `Event`, not a `ChartEvent`.  Add `@ts-ignore`; `getCanvasPosition` relied on some loose conversions between `Event`, `TouchEvent`, and `Touch` that would require several changes to make TypeScript happy.
    joshkel committed Feb 14, 2022
    Copy the full SHA
    0f99ce4 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2022

  1. Code review feedback

    Return the event directly, to speed up the code a bit.  Add JSDoc to help communicate its intent.  Update various comments.
    joshkel committed Feb 15, 2022
    Copy the full SHA
    77de6ef View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    03de123 View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2022

  1. Copy the full SHA
    d50c746 View commit details
    Browse the repository at this point in the history
  2. Update src/helpers/helpers.dom.js

    Only thing needed actually is the update of chartjs-test-utils to 0.4.0
    kurkle committed Mar 23, 2022
    Copy the full SHA
    597276e View commit details
    Browse the repository at this point in the history
  3. Bump chartjs-test-utils dependency

    To get supporting work from chartjs/chartjs-test-utils#19
    joshkel committed Mar 23, 2022
    Copy the full SHA
    b1c8310 View commit details
    Browse the repository at this point in the history