# Each tab is drawn by one script from scripts.histogram import histogram_tab from scripts.table import table_tab from scripts.time import time_tab # Using included state data from Bokeh for map # from bokeh.sampledata.us_states import data as states # output_file("nichd.html") # Read data into dataframes trials = pd.read_csv(join(dirname(__file__), 'data', 'SearchResults.csv'), index_col=0).dropna(subset=['Phases', 'Enrollment']) # Formatted Flight Delay Data for map # map_data = pd.read_csv(join(dirname(__file__), 'data', 'flights_map.csv'), # header=[0,1], index_col=0) # Create each of the tabs tab1 = histogram_tab(trials) # tab2 = density_tab(flights) tab3 = table_tab(trials) tab4 = time_tab(trials) # tab5 = route_tb(flights) # Put all the tabs into one application tabs = Tabs(tabs=[tab1, tab3, tab4]) # Put the tabs in the current document for display curdoc().add_root(tabs)
import pandas as pd from bokeh.io import curdoc from bokeh.models.widgets import Tabs from scripts.histogram import histogram_tab import json with open('config.json') as fp: config = json.load(fp) file_name = config['file_path'] df = pd.read_csv(file_name) tab1 = histogram_tab(df) tabs = Tabs(tabs=[tab1]) curdoc().add_root(tabs)
from scripts.density import density_tab from scripts.table import table_tab from scripts.draw_map import map_tab from scripts.routes import route_tab # Using included state data from Bokeh for map from bokeh.sampledata.us_states import data as states # Read data into dataframes flights = pd.read_csv(join(dirname(__file__), 'data', 'flights.csv'), index_col=0).dropna() # Formatted Flight Delay Data for map map_data = pd.read_csv(join(dirname(__file__), 'data', 'flights_map.csv'), header=[0,1], index_col=0) # Create each of the tabs tab1 = histogram_tab(flights) tab2 = density_tab(flights) tab3 = table_tab(flights) tab4 = map_tab(map_data, states) tab5 = route_tab(flights) # Put all the tabs into one application tabs = Tabs(tabs = [tab1, tab2, tab3, tab4, tab5]) # Put the tabs in the current document for display curdoc().add_root(tabs)
from bokeh.io import curdoc from bokeh.models.widgets import Tabs from bokeh.plotting import output_file, show # Each tab is drawn by one script from scripts.histogram import histogram_tab from scripts.density import density_tab from scripts.table import table_tab from scripts.plot import plot_tab # Read data into dataframes df_avgs_w_l = pd.read_pickle('df_avgs_w_l') df_avgs_w_l['rpi'] = pd.to_numeric(df_avgs_w_l['rpi'], errors='coerce') # Create each of the tabs tab1 = histogram_tab(df_avgs_w_l) tab2 = density_tab(df_avgs_w_l) tab3 = table_tab(df_avgs_w_l) tab4 = plot_tab(df_avgs_w_l) # tab5 = route_tb(flights) # Put all the tabs into one application tabs = Tabs(tabs=[tab1, tab2, tab3, tab4]) # Put the tabs in the current document for display curdoc().add_root(tabs) output_file('plots.html') show(tabs)
# Each tab is drawn by one script from scripts.histogram import histogram_tab # Using included state data from Bokeh for map from bokeh.sampledata.us_states import data as states # read and clean data df = pd.read_csv( 'bokeh_app/data/African_Studies_Journal_Review_Project_Database.csv', header=0, encoding='unicode_escape') cleaned_df = df.iloc[:, [0] + list(range(19, 140))] cleaned_df = cleaned_df.dropna() cleaned_df.iloc[:, range(21, 115)] = cleaned_df.iloc[:, range(21, 115)].astype(int) data = cleaned_df.iloc[:, [0, 7] + list(range(21, 115))] # Create each of the tabs tab1 = histogram_tab(data) # tab2 = density_tab(flights) # tab3 = table_tab(data) # tab4 = map_tab(map_data, states) # tab5 = route_tab(flights) # Put all the tabs into one application tabs = Tabs(tabs=[tab1]) # Put the tabs in the current document for display curdoc().add_root(tabs)
'mean', 'count': 'mean', 'income': 'mean', 'weight': 'mean', 'looped': 'mean' }) featlist = grouplabels.columns[2:] #print(featlist) # Create each of the tabs # histogram plot of features tab1 = histogram_tab(groupaddr, featlist) #time plot tab2 = timeplot_tab(grouplabels, lstlabels[1:]) # Put all the tabs into one application #tabs = Tabs(tabs =tab1) tabs = Tabs(tabs=[tab1, tab2]) # Put the tabs in the current document for display curdoc().add_root(tabs) # p = figure(plot_width=1800, plot_height=750, x_axis_type="datetime") # p.title.text = 'Click on legend entries to mute the corresponding lines' # for label, color in zip(lstlabels[1:],Spectral9): # df=grouplabels[grouplabels['label']==label].sort_values(by=['date'])