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

Export zoomRect and make it more configurable #659

Merged
merged 6 commits into from Sep 1, 2022

Commits on May 20, 2022

  1. Implement zoomRect functions

    Normal zooming supports customizing zoom behavior using zoomFunctions, but the drag-to-zoom functionality that's implemented by zoomRect bypasses zoomFunctions and calls updateRange correctly.
    
    I have a custom scale implementation that relies on zoomFunctions, so trying to enable drag-to-zoom causes problems. (Specifically, I'm breaking up the axis into viewports so that I can stack multiple series within this chart - somewhat like this example. The scales for the individual portions of the chart shouldn't be directly zoomed, because their layout is managed by a separate, controlling scale, so their zoomFunctions are no-ops.)
    
    Zooming by rectangle appears to be a distinctly different interface than zooming by percentage and focal point, so it seems reasonable to add a zoomRectFunctions to let scales customize that behavior and cover this use case.
    joshkel committed May 20, 2022
    Copy the full SHA
    d422095 View commit details
    Browse the repository at this point in the history
  2. Expose zoomRect; remove incorrect TypeScript type definitions

    To go with adding stronger zoomRect functionality, it makes sense to expose the `zoomRect` function directly.
    
    The TypeScript type definitions said that standalone functions like `zoom` were exported, but these don't actually exist.  Fix that.
    joshkel committed May 20, 2022
    Copy the full SHA
    98d8870 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2022

  1. Restore incorrectly deleted type definitions

    And properly export zoomRect.
    joshkel committed May 24, 2022
    Copy the full SHA
    2556f21 View commit details
    Browse the repository at this point in the history
  2. Further update comments

    joshkel committed May 24, 2022
    Copy the full SHA
    366487f View commit details
    Browse the repository at this point in the history
  3. Restore type tests

    joshkel committed May 24, 2022
    Copy the full SHA
    f9f826e View commit details
    Browse the repository at this point in the history
  4. Fix type

    joshkel committed May 24, 2022
    Copy the full SHA
    2196f7c View commit details
    Browse the repository at this point in the history