#NEWLINE# def callback( source = source , window = None ) : #NEWLINE# #INDENT# data = source . get ( 'data' ) #NEWLINE# ( A , B ) = ( amp . get ( 'value' ) , offset . get ( 'value' ) ) #NEWLINE# ( k , phi ) = ( freq . get ( 'value' ) , phase . get ( 'value' ) ) #NEWLINE# ( x , y ) = ( data [ 'x' ] , data [ 'y' ] ) #NEWLINE# for i in range ( len ( x ) ) : #NEWLINE# #INDENT# y [ i ] = ( B + ( A * window . Math . sin ( ( ( window * x [ i ] ) + phi ) ) ) ) #NEWLINE# #UNINDENT# source . trigger ( 'change' )