src/Behavior.js
/**
 * With no argument, toggle the node click on or off. Pass in a boolean argument
 * to set the on/off state.
 */
With no argument, toggle the node click on or off. Pass in a boolean argument
to set the on/off state.
With no argument toggle the node click on or off . Pass in a boolean argument to set the on / off state .
function toggle_selectable_click (on_off) {
  if (on_off === undefined) {
    on_off = this.selectable_mousedown === null
  }
  if (on_off) {
    var map = this.map
    this.selectable_mousedown = function (d) {
      d3_selection.event.stopPropagation()
    }
    this.selectable_click = function (d) {
      d3_selection.event.stopPropagation()
      if (d3_selection.event.defaultPrevented) return
      map.select_selectable(this, d, d3_selection.event.shiftKey)
    }
    this.node_mouseover = function (d) {
      d3_select(this).style('stroke-width', null)
      var current = parseFloat(d3_select(this).style('stroke-width'))
      if (!d3_select(this.parentNode).classed('selected'))
        d3_select(this).style('stroke-width', current * 3 + 'px')
    }
    this.node_mouseout = function (d) {
      d3_select(this).style('stroke-width', null)
    }
  } else {
    this.selectable_mousedown = null
    this.selectable_click = null
    this.node_mouseover = null
    this.node_mouseout = null
    this.map.sel.select('#nodes')
      .selectAll('.node-circle').style('stroke-width', null)
  }
}
function toggle_selectable_click ( on_off ) { if ( on_off === undefined ) { on_off = this . selectable_mousedown === null } if ( on_off ) { var map = this . map this . selectable_mousedown = function ( d ) { d3_selection . event . stopPropagation ( ) } this . selectable_click = function ( d ) { d3_selection . event . stopPropagation ( ) if ( d3_selection . event . defaultPrevented ) return map . select_selectable ( this , d , d3_selection . event . shiftKey ) } this . node_mouseover = function ( d ) { d3_select ( this ) . style ( 'stroke-width' , null ) var current = parseFloat ( d3_select ( this ) . style ( 'stroke-width' ) ) if ( ! d3_select ( this . parentNode ) . classed ( 'selected' ) ) d3_select ( this ) . style ( 'stroke-width' , current * 3 + 'px' ) } this . node_mouseout = function ( d ) { d3_select ( this ) . style ( 'stroke-width' , null ) } } else { this . selectable_mousedown = null this . selectable_click = null this . node_mouseover = null this . node_mouseout = null this . map . sel . select ( '#nodes' ) . selectAll ( '.node-circle' ) . style ( 'stroke-width' , null ) } }
With no argument, toggle the node click on or off.
With no argument toggle the node click on or off .
// stop propogation for the buildinput to work right // this.parentNode.__data__.was_selected = d3_select(this.parentNode).classed('selected') // d3_select(this.parentNode).classed('selected', true) // stop propogation for the buildinput to work right // click suppressed. This DOES have en effect. // turn off the temporary selection so select_selectable // works. This is a bit of a hack. // if (!this.parentNode.__data__.was_selected) //     d3_select(this.parentNode).classed('selected', false) // this.parentNode.__data__.was_selected = false