예제 #1
0
import dash_core_components as dcc
import plotly.graph_objs as go
import dash_table
from dash.dependencies import Input, Output
import pandas as pd

import app.template as template
from app.app import dash_app
from utils.google import Google

APPS_NAME = 'Promised Neverland Season 2'
g = Google()
df = g.get_data()
df['Date'] = pd.to_datetime(df['Date'])
df_table = df.copy()
df_table['Date'] = df_table['Date'].dt.strftime('%m/%d/%Y')
df_table = df_table.drop(columns=['Source'])


dropdown_menu = dcc.Dropdown(id='data-input-' + APPS_NAME,
                            options=[ {'label': 'MAL', 'value': 'Score'}],
                            value=['Score'],
                            multi=True)

table = dash_table.DataTable(
    id='table',
    columns=[{"name": i, "id": i} for i in df_table.columns],
    style_cell={'textAlign': 'center'},
    style_header={
        'backgroundColor': 'rgb(230, 230, 230)',
        'fontWeight': 'bold'