All examples By author By category About

micahstubbs

zoom & drag event filtering

an es2015 iteration on the block D3 event filtering from @pkerpedjiev

this iteration also makes sure the title text is not accidentally selected when attemption to drag over an un-draggable red circle:

  svg.selectAll('text')
    .style('-webkit-user-select', 'none') /* Chrome/Safari */
    .style('-moz-user-select', 'none') /* Firefox */
    .style('-ms-user-select', 'none') /* IE10+ */

credit to this stackoverflow answer for the styles to make text un-selectable in most browsers