src/plot/crosshair.js
function crosshair(g) {
      var group = g.selectAll('g.data.top').data([change], function(d) { return d; }),
          groupEnter = group.enter(),
          dataEnter = groupEnter.append('g').attr('class', 'data top').style('display', 'none');

      group.exit().remove();

      dataEnter.append('path').attr('class', 'horizontal wire');
      dataEnter.append('path').attr('class', 'vertical wire');

      plot.annotation.append(dataEnter, xAnnotation, 'x');
      plot.annotation.append(dataEnter, yAnnotation, 'y');

      g.selectAll('rect').data([0]).enter().append('rect').style({ fill: 'none', 'pointer-events': 'all' });

      crosshair.refresh(g);
    }
function crosshair(g) {
      var group = g.selectAll('g.data.top').data([change], function(d) { return d; }),
          groupEnter = group.enter(),
          dataEnter = groupEnter.append('g').attr('class', 'data top').style('display', 'none');

      group.exit().remove();

      dataEnter.append('path').attr('class', 'horizontal wire');
      dataEnter.append('path').attr('class', 'vertical wire');

      plot.annotation.append(dataEnter, xAnnotation, 'x');
      plot.annotation.append(dataEnter, yAnnotation, 'y');

      g.selectAll('rect').data([0]).enter().append('rect').style({ fill: 'none', 'pointer-events': 'all' });

      crosshair.refresh(g);
    }
function crosshair ( g ) { var group = g . selectAll ( 'g.data.top' ) . data ( [ change ] , function ( d ) { return d ; } ) , groupEnter = group . enter ( ) , dataEnter = groupEnter . append ( 'g' ) . attr ( 'class' , 'data top' ) . style ( 'display' , 'none' ) ; group . exit ( ) . remove ( ) ; dataEnter . append ( 'path' ) . attr ( 'class' , 'horizontal wire' ) ; dataEnter . append ( 'path' ) . attr ( 'class' , 'vertical wire' ) ; plot . annotation . append ( dataEnter , xAnnotation , 'x' ) ; plot . annotation . append ( dataEnter , yAnnotation , 'y' ) ; g . selectAll ( 'rect' ) . data ( [ 0 ] ) . enter ( ) . append ( 'rect' ) . style ( { fill : 'none' , 'pointer-events' : 'all' } ) ; crosshair . refresh ( g ) ; }
Track changes to this object, to know when to redraw
Track changes to this object to know when to redraw