0

I have a map in d3.js with a mouseover event connected to the sub-areas. There are a lot of sub-areas. When the mouse gets moved fast over the map, the cpu becomes overloaded because of all the launched events (which aren't of any use to the user in that case). So how do I make sure the events only launch when the pointer stays in the given area for at least 500ms e.g. ?

S Leon
  • 331
  • 1
  • 4
  • 18
  • May be this thread can help? [detect-how-many-seconds-a-mouse-stays][1] [1]: http://stackoverflow.com/questions/7150219/jquery-detect-how-many-seconds-a-mouse-stays-over-element – huan feng Dec 01 '14 at 02:26

1 Answers1

0

Use a DeBounced draw as in this example: (Just Check the debounced_draw code section, the example is different to your use case)

Whats the best way to make a d3.js visualisation layout responsive?

Community
  • 1
  • 1