panEnd event

31 views
Skip to first unread message

Glenn Matthys

unread,
Apr 1, 2017, 4:00:27 PM4/1/17
to dygraphs-users
I'm looking for a way to attach a function on pan end, like zoomCallback. I'm writing an app in plain JS but I can't find a way to properly detect the end of panning. What I've tried:
  • Found an example on replacing the pan handler here, but that doesn't work for me, Dygraph.Interaction = undefined.
  • If I add { endPan: function() {...} } to Dygraph.defaultInteractionModel, that function is never called.
  • Here's another example by adding endPan to the Dygraph function here, but that doesn't work either.
  • Attached a mouseup/touchend event, but dateWindow_ is only updated after mouseup/touchend.
Reading through the comments in dygraph.js, it used to be possible to set a function on panEnd (line 2861), but that code is commented with "old ways of accessing these methods/properties", but doesn't say what the new way is. I've experimented with drawCallback, but walking the dygraph object doesn't reveal any variable that exposes if the user is still busy panning or not.

Is there a way to execute code on pan end?

Thanks,
Reply all
Reply to author
Forward
0 new messages