examples/scatterplot/axes.rb
def update(x_scale, y_scale)

    @x_axis.scale = x_scale
    @y_axis.scale = y_scale

    # update x_axis
    @x_svg.attr("transform", "translate(0, #{@chart.height - @chart.padding})")
      .call(@x_axis)

    # update y_axis
    @y_svg.attr("transform", "translate(#{@chart.padding}, 0)")
      .call(@y_axis)
    
  end
#--------------------------------------------------------------------------------------
# Updates the x and y axis
# @param x_scale [d3 scale function] the x scale for this axis
# @param y_scale [d3 scale function] the y scale for this axis
#--------------------------------------------------------------------------------------
Updates the x and y axis
Updates the x and y axis
def update(x_scale, y_scale)
    @x_axis.scale = x_scale
    @y_axis.scale = y_scale
    @x_svg.attr("transform", "translate(0, #{@chart.height - @chart.padding})")
      .call(@x_axis)
    @y_svg.attr("transform", "translate(#{@chart.padding}, 0)")
      .call(@y_axis)
  end
def update ( x_scale , y_scale ) @x_axis . scale = x_scale @y_axis . scale = y_scale @x_svg . attr ( "transform" , "translate(0, #{@chart.height - @chart.padding})" ) . call ( @x_axis ) @y_svg . attr ( "transform" , "translate(#{@chart.padding}, 0)" ) . call ( @y_axis ) end
Updates the x and y axis
Updates the x and y axis
# update x_axis # update y_axis
x_scale
the x scale for this axis
the x scale for this axis
y_scale
the y scale for this axis
the y scale for this axis