Skip to content
Source
Sign inSign up
TanStack/charts

brushX with `values` can shorten the selection range when it’s dragged to the plot edge #170

Closedandersk(GitHub profile, opens in a new tab) opened this issue 1 comment

When a brushX with explicit values sits over an x domain that extends past its first and last values, dragging the selected range all the way to either edge of the plot may shorten the selected range by one value. Each further drag to an edge can shorten it again. This happens due to independent rounding of the two endpoints.

Reproduction: https://jsfiddle.net/anderskaseorg/ty3hz9m8/

  1. Open the page. The range is 2024-01-02 to 2024-01-04 (3 days).
  2. Drag the selection all the way to the left. The range shortens to 2024-01-01 to 2024-01-02 (2 days).
  3. Drag the selection all the way to the right. The range shortens to 2024-01-05 to 2024-01-05 (1 day).
  1. Fixed in 1.1.0 through #184. Dragging a brush with explicit values preserves the selected-value count at either edge, with coverage for reversed axes, uneven spacing, and values changing during a drag. Thanks @andersk for the reproduction and #173.

  2. tannerlinsley closed this

Sign in to join this conversation.