#NEWLINE# def update_frame( self , key , ranges = None , element = None , empty = False ) : #NEWLINE# #INDENT# '\n        Update the internal state of the Plot to represent the given\n        key tuple (where integers represent frames). Returns this\n        state.\n        ' #NEWLINE# if ( element is None ) : #NEWLINE# #INDENT# element = self . _get_frame ( key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . current_frame = element #NEWLINE# self . current_key = key #NEWLINE# #UNINDENT# if isinstance ( self . hmap , DynamicMap ) : #NEWLINE# #INDENT# range_obj = element #NEWLINE# items = element . items ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# range_obj = self . hmap #NEWLINE# items = element . items ( ) #NEWLINE# #UNINDENT# all_empty = empty #NEWLINE# ranges = self . compute_ranges ( range_obj , key , ranges ) #NEWLINE# for ( k , subplot ) in self . subplots . items ( ) : #NEWLINE# #INDENT# ( empty , el ) = ( False , None ) #NEWLINE# if isinstance ( self . hmap , DynamicMap ) : #NEWLINE# #INDENT# idx = dynamic_update ( self , subplot , k , element , items ) #NEWLINE# empty = ( idx is None ) #NEWLINE# if ( not empty ) : #NEWLINE# #INDENT# ( _ , el ) = items . pop ( idx ) #NEWLINE# #UNINDENT# #UNINDENT# subplot . update_frame ( key , ranges , element = el , empty = ( empty or all_empty ) ) #NEWLINE# #UNINDENT# if ( isinstance ( self . hmap , DynamicMap ) and items ) : #NEWLINE# #INDENT# raise Exception ( 'Some Elements returned by the dynamic callback were not initialized correctly and could not be rendered.' ) #NEWLINE# #UNINDENT# if ( ( not self . overlaid ) and ( not self . tabs ) ) : #NEWLINE# #INDENT# self . _update_ranges ( element , ranges ) #NEWLINE# self . _update_plot ( key , self . handles [ 'plot' ] , element )