# from your computer or server @app.server.route('{}<image_path>.svg'.format(static_image_route)) def serve_image(image_path): image_name = '{}.svg'.format(image_path) if image_name not in list_of_images: raise Exception( '"{}" is excluded from the allowed static files'.format( image_path)) return flask.send_from_directory(image_directory, image_name) start_image_server() #~ app.scripts.append_script({ "external_url": "app.js"}) from lib.interface import get_available_metrics example_wikis = ['eslagunanegra_pages_full', 'cocktails', 'zelda'] app.layout = html.Div(id='app-layout', style={'display': 'flex'}, children=[ generate_side_bar(example_wikis, get_available_metrics()), ]) bind_callbacks(app) app.css.append_css( {"external_url": "https://codepen.io/chriddyp/pen/bWLwgP.css"}) app.css.append_css( {"external_url": "https://codepen.io/akronix/pen/rpQgqQ.css"}) app.run_server(port=8052, debug=True)
#query_str = urlencode(selection, doseq=True) #href = '/download/?' + query_str; #return href return # bind_callbacks if __name__ == '__main__': data_dir = os.getenv('WIKICHRON_DATA_DIR', 'data') wikis = [ 'eslagunanegra_pages_full', 'cocktails', 'es.shamanking.wikia.com' ] available_metrics = lib.get_available_metrics() metrics = [] metrics.append(available_metrics[0]) metrics.append(available_metrics[1]) app = dash.Dash() app.css.append_css( {"external_url": "https://codepen.io/chriddyp/pen/bWLwgP.css"}) app.css.append_css({ "external_url": "https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css" }) relative_time = False app.layout = generate_main_content(wikis, metrics, relative_time)