Export Image
Export Code

[05] Interactivity - Using React Hooks with D3

gjonor

Last edited Feb 22, 2020
Created on Feb 19, 2020

2020-w08-3

Tutorials by The Muratorium:

Using React (Hooks) with D3

  • [05] Interactivity
  • Apply selection.on() before transition()
  • On mouseenter, mouseleave events
  • selectAll tooltip and join with single element data
  • For x position, use the index value from the closure, not the index of the tooltip datum
  • Opacity transition to 1
  • Reset animation by removing element on mouseleave
  • Center text with text-anchor="middle" and offset by half bandwidth()
  • join(enter) callback argument to define elements with enter.append()
  • Specify initial tooltip position in enter selection
MIT Licensed