#NEWLINE# def models_to_json( models ) : #NEWLINE# #INDENT# '\n    Convert list of bokeh models into json to update plot(s).\n    ' #NEWLINE# ( json_data , ids ) = ( [ ] , [ ] ) #NEWLINE# for plotobj in models : #NEWLINE# #INDENT# if ( plotobj . ref [ 'id' ] in ids ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ids . append ( plotobj . ref [ 'id' ] ) #NEWLINE# #UNINDENT# if bokeh_lt_011 : #NEWLINE# #INDENT# json = plotobj . vm_serialize ( changed_only = True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# json = plotobj . to_json ( False ) #NEWLINE# json . pop ( 'tool_events' , None ) #NEWLINE# json . pop ( 'renderers' , None ) #NEWLINE# json_data . append ( { #NEWLINE# #INDENT# 'id' : plotobj . ref [ 'id' ] , #NEWLINE# 'type' : plotobj . ref [ 'type' ] , #NEWLINE# 'data' : json , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return json