Пример #1
0
def plot_figure(zipcode):

    data, data_list_deaths, data_list_recovered, date_list, region_of_interest = utl.load_data_2()

    #data, date_list = utl.search_by_zipcode(zipcode)

    print(data)

    data = [go.Scatter(x=date_list,
                       y=data,
                       mode="markers+lines",
                       marker_symbol=raw_symbols[0],
                       marker_line_color="red",
                       marker_color="lightskyblue",
                       marker_line_width=2, marker_size=15)]

    graph = dcc.Graph(
        figure={
            'data': data,
            'layout': go.Layout(
                title='{} confirmed case change'.format(zipcode),
                yaxis={'title': 'confirmed case'},
                hovermode='closest'
            )
        }
    )
    return graph
Пример #2
0
def load_case_list(region="US"):
    data_list_confirmed, data_list_deaths, data_list_recovered, date_list, region_of_interest = utl.load_data_2(
    )
    return data_list_confirmed[region]
Пример #3
0
def load_case_list_regions():  # return data for all retions-of-interest
    data_list_confirmed, data_list_deaths, data_list_recovered, date_list, region_of_interest = utl.load_data_2(
    )
    return data_list_confirmed, data_list_deaths, data_list_recovered, date_list, region_of_interest
Пример #4
0
def plot_figure(region):

    data_list_confirmed, data_list_deaths, data_list_recovered, date_list, region_of_interest = utl.load_data_2()

    #print(region, data_list_confirmed[region])
    #print("date list ", date_list)

    data = [go.Scatter(x=date_list,
                       y=data_list_confirmed[region],
                       mode="markers+lines",
                       marker_symbol=raw_symbols[4],
                       marker_line_color="blue",
                       marker_color="red",
                       marker_line_width=2, marker_size=15)]

    graph = dcc.Graph(
        figure={
            'data': data,
            'layout': go.Layout(
                title='{} confirmed case change over date'.format(region),
                yaxis={'title': 'Population'},
                hovermode='closest'
            )
        }
    )
    return graph
Пример #5
0
def load_options():
    data_list_confirmed, data_list_deaths, data_list_recovered, date_list, region_of_interest = utl.load_data_2()
    options = [{'label': x, 'value': x} for x in region_of_interest]

    return options