toyplot icon indicating copy to clipboard operation
toyplot copied to clipboard

Activating the context menu on plots is difficult.

Open tshead2 opened this issue 9 years ago • 1 comments

It's hard to hit the line. We should probably be highlighting / selecting whatever is closest to the cursor.

tshead2 avatar Jan 23 '16 00:01 tshead2

Broadly speaking, there are a couple of options:

  • Add invisible geometry that can receive mouseover events.
    • Pro: just works for arbitrary complexity shapes, Bezier paths, etc.
    • Con: where there's overlap, the order in which a region is chosen is fixed.
      • In theory, getIntersectionList() could be used, but it's missing on Firefox and buggy elsewhere.
  • Add spatial indexing such as kd trees.
    • Pro: Can be used to search for nearest neighbors, no matter the scene complexity.
    • Con: search for shapes other than points is trickier - at a minimum we would need nearest line segment for plots and spines, plus nearest rect for bars, plus fills.
      • Looks like maybe a quad tree is what we want.

tshead2 avatar Jan 23 '16 16:01 tshead2