0

The Plottable Click Interaction doesn't pass the callback any sort of event (synthetic or otherwise) so I can't figure out a way to determine which button was clicked.

Has anyone wired up the right mouse button to a Plottable chart?

Joel Mellon
  • 3,672
  • 1
  • 26
  • 25

2 Answers2

1

This problem was fixed recently here https://github.com/palantir/plottable/pull/3130.

vin
  • 823
  • 1
  • 10
  • 15
0

The solution I ended up implementing is a bit of a hack, but since I don't have access to the click event, I decided to use a combination of a native event and a Plottable Interaction.

Using a native event listener I register an onClick on the entire svg and use the passed in event to determine which button was clicked. That's only half the solution though, since I no longer have the point (x/y coord) of where on the dataPane was clicked. To get that I registered a callback with Plottable's Interaction.Pointer.onPointerMove() in effect recording the mouse position perpetually by setting a global variable, so my click callback has access to the Point, and I can determine what on the chart was clicked.

Joel Mellon
  • 3,672
  • 1
  • 26
  • 25