plottable icon indicating copy to clipboard operation
plottable copied to clipboard

Interaction attachment order determines entityNearestByXThenY behavior

Open waltonseymour opened this issue 7 years ago • 0 comments

Bug report

When using entityNearestByXThenY inside an onPointerMove callback the returned entity is different depending upon whether or not a panZoom is attached before or after the pointer interaction.

Live example URL: https://jsfiddle.net/8zu0qgp4/6/ Live example URL: https://jsfiddle.net/8zu0qgp4/7/

The difference between these two is simply the order the interactions are attached.

Steps to repro:

  1. Drag to pan in the first example to see the index does not change.
  2. Drag to pan in the second example to see the index changes with the cursor movement.

Expected behavior

I would expect the behavior to remain the same. I think keeping the returned element stable during a pan makes the most sense. It might make sense to have this configurable on the panZoom interaction. Either way this should be documented somehow.

Actual behavior

The returned entities are different between the two orderings.

  • Plottable version: 3.7.0
  • Browser name/version: Chrome 61.0.3163.100
  • OS name/version: MacOS 10.13

waltonseymour avatar Nov 10 '17 23:11 waltonseymour