xdrop.on_change('value', update_xdrop) # create the Panel and Tabs objects for setting up the investment parameters panels = [] for param in r0.keys(): panels.append(create_panel(param, r0[param])) tabs = Tabs(tabs=panels, width=1000) # create the app layout top = row(fig, widgetbox(xdrop, width=300)) layout = column(top, tabs) # update the document and initialize the app by setting the Dropdown value curdoc().add_root(layout) param0 = list(r0.keys())[0] xdrop.value = list(r0[param0].keys())[0] # output_file('tmp.html') # show(layout) # # create a column layout of widgets for setting the dynamic parameters # dlist = [] # for d in dynamic:
div_total_invested_capital = Div() div_monthly_cash_flow = Div() div_sale_profit = Div() div_investment_metrics = Div() divs = column( widgetbox(div_total_invested_capital, width=400), widgetbox(div_monthly_cash_flow, width=400), widgetbox(div_sale_profit, width=400), widgetbox(div_investment_metrics, width=400)) # create the app layout, update curdoc drops = column( widgetbox(ytext, width=300), widgetbox(ydrop, width=300), widgetbox(xtext, width=300), widgetbox(xdrop, width=300)) top_left = row(drops, fig) bottom_left = row(panels) left = column(top_left, bottom_left) layout = row(left, divs) curdoc().add_root(layout) # initialize the app thru setting the initial Dropdown value and callbacks param0 = list(r0.keys())[0] xdrop.label = list(r0[param0].keys())[0] xdrop.value = xdrop.label ydrop.label = ymenu[0] xdrop.on_change('value', partial(update_drop, drop_type='x')) ydrop.on_change('value', partial(update_drop, drop_type='y')) ydrop.value = ydrop.label