Skip to content

Option to snap to data point boundary on brushing #851

Open

Description

Is your feature request related to a problem? Please describe.
This is discussed in elastic/kibana#79435 - in some cases it doesn't make sense to have a pixel perfect brushing because it results in odd numbers for the defined range.

Describe the solution you'd like
There should be an option for the brushed area to snap to the nearest boundary between data points on the x axis (for both beginning and end). This could be enabled if the user is holding down the shift key while brushing. I'm not sure whether elastic-charts or the consumer should control the shift key in that case.

Describe alternatives you've considered
It's possible to do the "snapping" in the brushing handler on consumer side, but in that case the resulting range wouldn't be represented correctly in the chart during brushing.

Additional context
We have to be careful with this - I don't think it is the right choice to enable by default because there are valid use cases for brushes more granular than the data resolution (e.g. selecting one data point plus some context of half a data point left and right to zoom in)

Checklist

  • this request is checked against already exist requests
  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    :interactionsInteractions related issue:xyBar/Line/Area chart relatedenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions