hr() ]) for component in component_list]), ]), # Display this app code on the right column div(className="six columns", style=dict(borderLeft='1px solid #E1E1E1', paddingLeft='4%', **column_style), content=[ h4('App Code'), hr(), pre(open(os.path.basename(__file__)).read()) ]) ]) ]) def display_component_repr(component): return { 'content': str(component) } for component in component_list: # Update each component's "pre" with its representation when it changes # Normally a decorator like @dash.react('graph-repr', ['graph']) dash.react(component.id + '-repr', [component.id])(display_component_repr) if __name__ == '__main__': dash.server.run(port=8080, debug=True)
pre(id=component.id + '-repr'), hr() ]) for component in component_list ]), ]), # Display this app code on the right column div(className="six columns", style=dict(borderLeft='1px solid #E1E1E1', paddingLeft='4%', **column_style), content=[ h4('App Code'), hr(), pre(open(os.path.basename(__file__)).read()) ]) ]) ]) def display_component_repr(component): return {'content': str(component)} for component in component_list: # Update each component's "pre" with its representation when it changes # Normally a decorator like @dash.react('graph-repr', ['graph']) dash.react(component.id + '-repr', [component.id])(display_component_repr) if __name__ == '__main__': dash.server.run(port=8080, debug=True)