def layout(): # load data for display episodesummdata = chart_utils.get_loaded_data( "AXXESS_API.USER_INPUTS.VW_PENDING_ORDERS_TF_SIMPLE", "DATASET") #reorder the columns new_order = [ 'INS_CODE', 'INITIAL_TIMELY_FILING', 'MRN', 'PATIENT', 'PATIENT_STATUS', 'DATE_OF_BIRTH', 'EPISODE_START_DATE', 'EPISODE_END_DATE', 'PHYSICIAN_NAME', 'PHYSICIAN_PHONE', 'PHYSICIAN_FACSIMILE', 'ORDERS_DETAILS', 'CONSOLIDATED_COMMENTS', 'COLOR', 'USER_UPDATE_DATE', 'NEW_COMMENTS', 'EPISODE_UNEARNED_AMOUNT', 'EPISODE_EARNED_AMOUNT', 'EPISODE_BILLED_AMOUNT', 'EPISODE_ADJUSTMENTS' ] episodesummdata = episodesummdata[new_order] claimsdetailsdata = chart_utils.get_loaded_data( "AXXESS_API.RAW.VW_ALLPAYOR_BILLING_CLAIMS_DETAILS", "DATASET") # print(episodesummdata.columns) # print(claimsdetailsdata.columns) gl_mrn_arr = chart_utils.get_options(episodesummdata, "MRN") gl_ins_code_arr = chart_utils.get_options(episodesummdata, "INS_CODE") gl_patient_arr = chart_utils.get_options(episodesummdata, "PATIENT") gl_patient_status_arr = chart_utils.get_options(episodesummdata, "PATIENT_STATUS") remove_cols = ['BRANCH', 'COLUMN_MAPPING', 'COLUMN_PARAMETERS'] max_date = pd.to_datetime(episodesummdata['EPISODE_END_DATE']).max() min_date = pd.to_datetime(episodesummdata['EPISODE_END_DATE']).min() children = html.Div([ # block on the right ddk.Block( width=100, children=[ ddk.Row([ ddk.Block(children=[ ddk.ControlCard( orientation='horizontal', width=100, children=[ html.Details([ html.Summary("Filter here"), html. P("""Select attributes to fine tune tables.""" ), ]), ddk.ControlItem( dcc.Dropdown( options=gl_ins_code_arr, multi=True, placeholder="Select Ins code", id="op-ins-code-selector" # value=["Not Yet Started", "Saved"], )), ddk.ControlItem( dcc.Dropdown( options=gl_patient_arr, multi=True, placeholder="Select Patient", id="op-patient-selector" # value=["Not Yet Started", "Saved"], )), ddk.ControlItem( dcc.Dropdown( options=gl_mrn_arr, multi=True, placeholder="Select MRN", id="op-mrn-selector" # value=["Not Yet Started", "Saved"], )), ddk.ControlItem( dcc.DatePickerRange( id="op-episode-picker", min_date_allowed=pd.to_datetime( episodesummdata[ 'EPISODE_START_DATE'].min()), max_date_allowed=max_date, initial_visible_month=max_date, start_date=min_date, end_date=max_date), ), ddk.ControlItem( html.Button( id="op-select-all-rows", children="Select all matching records", style={"margin": "auto"}, n_clicks=0, )), ], ) ]), ]), ddk.Row([ ddk.Card(children=[ ddk.CardHeader( title="Pending Orders", children=[ html.Div([ ddk.Modal( id="op-modal-btn-outer", children=[ html.Button( id="op-expand-modal", n_clicks=0, children="Take action", ) ], target_id="op-modal-content", hide_target=True, style={"float": "right"}, ), ddk.Block( id="op-modal-content", children=html.Div(id="op-modal-div"), style={ "width": "50%", "margin": "auto", "overflow": "scroll", }, ), ]), ], ), ddk.Block(children=[ generate_table_layout( episodesummdata, "PENDING ORDERS", "pending_tf-table", "MRN", remove_cols) ]) ]), ]), ddk.Row([ ddk.Block(children=[ generate_table_layout( claimsdetailsdata, "CLAIMS DETAILS", "op_claims_details-table", "MRN", remove_cols) ]) ]), ]) ]) return children
i, nsdq.loc[i]['Name']), 'value': i } for i in nsdq.index], multi=True, value=["GOOG"]) ]), dfx.Col(xs=12, lg=4, className='date_filter_container', children=[ html.Label("Select start and end dates:"), dcc.DatePickerRange( id='date_filter', start_date=dt(2018, 1, 1), end_date=dt.today(), min_date_allowed=dt(2014, 1, 1), max_date_allowed=dt.today(), ) ]), dfx.Col( xs=12, lg=2, className="submit_button", children=[html.Div(id="submit_button", children="Submit")]) ]), dfx.Row(className='graph_container', children=[ dfx.Col(className='dataTable', id='stock_data_table', children=[
from datetime import date from model import model # 4) Create a Dash app app = dash.Dash(__name__) # 5) Create the page layout app.layout = html.Div([ # Hidden div inside the app that stores bond features from model html.Div(id='model-output', style={'display': 'none'}), # Hidden div inside the app that stores IVV price data html.Div(id='ivv-historical-data', style={'display': 'none'}), # Date range for update historical data dcc.DatePickerRange(id='ivv-historical-data-range', min_date_allowed=date(2015, 1, 1), max_date_allowed=date.today(), initial_visible_month=date.today(), start_date=date(2021, 3, 26), end_date=date.today()), html.Div(id='output-container-date-picker-range'), dcc.Input(id='bbg-identifier-1', type="text", value="IVV US Equity"), html.Button("UPDATE", id='update-hist-dta-button', n_clicks=0), # Hidden div inside the app that stores bonds rates data html.Div(id='bonds-historical-data', style={'display': 'none'}), dcc.Graph(id='bonds-3d-graph', style={'display': 'none'}) ]) @app.callback( [ dash.dependencies.Output('bonds-historical-data', 'children'), dash.dependencies.Output('bonds-3d-graph', 'figure'),
# the outputs that allows interactivity between components. ############################################################################################### header_stu = html.Div( [ dbc.Row([ dbc.Col( html.Div( [ html.Hr(), html.H5("Admission Date"), dcc.DatePickerRange( id='my-date-picker-range', min_date_allowed=min_date, max_date_allowed=max_date, start_date=df.fecha_ingreso.min(), end_date=df.fecha_ingreso.max(), #start_date=date(2015, 1, 1), #end_date=date(2020, 1, 1), style={ 'backgroundColor': '#1f2630', 'color': '7FDBFF' }) ], className="date_picker"), width=4), dbc.Col(html.Div([ html.Hr(), html.H5("Age"), dcc.RangeSlider(id="RangeSlider_age", min=df["edad"].min(), max=df["edad"].max(), value=[df["edad"].min(), df["edad"].max()],
dbc.Col( children=[ html.P( "Date", style={ "font-size": "16px", "font-weight": "bold", "color": "#7c795d", }, ), dcc.DatePickerRange( id="date-picker-range", min_date_allowed=dt( 2020, 7, 20), max_date_allowed=datetime.date. today(), start_date=datetime.date.today( ), end_date=datetime.date.today(), show_outside_days=True, minimum_nights=0, ), ], width="auto", ), ], style={ "padding-left": "100px", "padding-top": "20px", }, ), dcc.Graph(id="data-plot-range",
value='monthly', id="freq_group", inline=True, ), ])), dbc.Row( html.H4( dbc.Badge( "Pick a date range", style={"background-color": "#072955"}, className="ml-1"))), dbc.Row( dcc.DatePickerRange( id='date-picker-range', min_date_allowed=date(2020, 1, 1), max_date_allowed=date(2100, 12, 31), initial_visible_month=date(2020, 1, 1), start_date=date(2020, 1, 1), end_date=date(2020, 12, 31), )), ]), style={"background-color": "#FFB71B"}, className="shadow-lg "), ], width=3), dbc.Col(dbc.Card(dbc.CardBody( [ dcc.Graph(id='group_plot', figure={}), ], style={ "background-color": "#072955", 'padding': '8px'
def render_content(tab): if tab == 'tab-1-example': return html.Div([ html.Div(id='searched-value', style={'display': 'none', 'color': 'red'}), html.Div(id='searched-value-stream', style={'display': 'none', 'color': 'red'}), html.Div(id='stream-clicks', style={'display': 'none', 'color': 'red'}), html.Div([ dcc.Input(id='sentiment_term', value="", type='text', disabled=False, style={'width': '30%', 'margin-right': 10, }, ), html.Button(id='submit-button', n_clicks=0, children='Start Streaming', style={ 'cursor': 'pointer', 'background-color': colors['background'], 'color': colors['font-color'], }), # dcc.RadioItems( # id='buttons', # options=[{'label': i, 'value': i} for i in ['Update live', 'Static']], # value='Static', # ), ], style={'width': '100%', 'margin-left': 30, 'margin-right': 10, 'max-width': 50000, 'display': 'inline-block'} ), # html.Div(id='tweet-info'), html.P(), dcc.Interval(id='graph-update', ), dcc.Interval(id='table-update', ), html.Div (id='live-graph-container', children=[ loading_component ], style={ 'width': '49%', 'display': 'inline-block', }, ), html.Div(className='row', children=[html.Div(id="tweets-table", className='col s12 m6 l6')], style={ "color": colors['font-color'], "fontSize": "16", "borderBottom": "1px solid #C8D4E3", "border": "1px", "font-size": "1.3rem", "width": "50%", 'display': 'inline-block' }, ), ]) elif tab == 'tab-2-example': return html.Div([ html.Div([ dcc.Input(id='searched-word-input', value="", type='text', disabled=False, size=60, style={ 'margin-right': 10, 'width': '30%', } ), html.Button(id='searched-button', n_clicks=0, children='Search', style={ 'cursor': 'pointer', 'background-color': colors['background'], 'color': colors['font-color'], }), ], style={'width': '100%', 'margin-left': 30, 'margin-right': 10, 'max-width': 50000, 'display': 'inline-block' } ), html.Div([ html.Div(id='historical-graph-container', children=[ loading_component ], style={'verticalAlign': 'center', } ), html.P(), # html.Div(id='date-slider-container', children=[ # ], style={'verticalAlign': 'center', # 'margin-left': 30, # }, # ), html.Div([html.H5('Select a start and end date:'), dcc.DatePickerRange(id='my-date-picker', min_date_allowed=datetime(2018, 10, 1), max_date_allowed=datetime.today() + timedelta(days=1), start_date=datetime(2018, 10, 1), end_date= datetime.today() + timedelta(days=1), display_format='YYYY-MM-DD', )], style={'display': 'center', 'margin-left': 50}) ], style={ 'width': '49%', 'display': 'inline-block', }, ), html.Div(id='historical-pie-container', children=[ loading_component ], style={'width': '49%', 'display': 'inline-block', } ), # html.Div(className='row', children=[ # html.Div(id="historical-tweets-table", className='col s12 m6 l6')], # style={ # "color": colors['font-color'], # "fontSize": "16", # "borderBottom": "1px solid #C8D4E3", # "border": "1px", # "font-size": "1.3rem", # "width": "50%", # "height": "600", # 'display': 'inline-block', # }, # ), ])
options=[{ "label": avocado_type, "value": avocado_type } for avocado_type in data.type.unique()], value="organic", clearable=False, searchable=False, className="dropdown", ), ], ), html.Div(children=[ html.Div(children="Date Range", className="menu-title"), dcc.DatePickerRange( id="date-range", min_date_allowed=data.Date.min().date(), max_date_allowed=data.Date.max().date(), start_date=data.Date.min().date(), end_date=data.Date.max().date(), ), ]), ], className="menu", ), html.Div( children=[ html.Div( children=dcc.Graph( id="price-chart", config={"displayModeBar": False}, ), className="card",
}, { "label": "Plovdiv", "value": "PLO" }, { "label": "Sofia", "value": "SO" }], value="SO"), html.Button("Submit", id="submit_form"), html.Br(), html.Br(), dcc.DatePickerSingle(id="dt-pick-single", date=dt(2020, 6, 22)), html.Br(), html.Br(), dcc.DatePickerRange(id="dt-pick-range1", start_date=dt(2020, 2, 20), end_date=dt(2020, 6, 12)), html.Br(), html.Br(), dcc.DatePickerRange(id="dt-pick-range2", start_date=dt(2020, 2, 20), end_date_placeholder_text="Select the date"), html.Br(), html.Br(), dcc.DatePickerRange(id="dt-pick-range3", start_date_placeholder_text="Select start date", end_date_placeholder_text="Select end date") ]) if __name__ == "__main__": app.run_server(port=5050)
dcc.RadioItems( id="leverage-select", options=[{ 'label': str(label), 'value': label } for label in df['Margin'].unique()], value=1, labelStyle={'display': 'inline-block' }), ]), html.Div(className="three columns card", children=[ html.H6("Select a Date Range"), dcc.DatePickerRange( id="date-range", display_format="MMM YY", start_date=df['Entry time'].min(), end_date=df['Entry time'].max()), ]), html.Div( id="strat-returns-div", className= "two columns indicator pretty_container", children=[ html.P(id="strat-returns", className="indicator_value"), html. P('Strategy Returns', className="twelve columns indicator_text" ), ]),
} for i in stock_choices], value='AAPL') ], style={ 'width': '45%', 'display': 'inline-block', 'horizontal-align': 'center', 'vertical-align': 'top' }), # The right widget - used to select the date html.Div([ html.H1('Pick Date Range'), dcc.DatePickerRange( id='date_range', min_date_allowed=first_date, max_date_allowed=today, initial_visible_month=today - relativedelta(months=6), start_date=today - relativedelta(months=6), end_date=today) ], style={ 'width': '45%', 'display': 'inline-block', 'textAlign': 'center' }), html.P( html.Button(id='input_button', n_clicks=0, children='Submit', style=dict(fontSize=18))), dcc.Graph(id='candlestick')
table, which will improve your model and give you better results for the next learning phase. (Still building this functionnality) ''', style={ 'font_family': 'Georgia', 'font-size': '120%' }), html.P(id="change_issue_message", children="placeholder"), dcc.Dropdown(id='categories', options=[{ 'label': i, 'value': i } for i in ISSUE_NAMES], multi=True), dcc.DatePickerRange(id="issue_date_picker", start_date=date(2018, 1, 1), end_date=arrow.get().date()), html.Button("update datebase", id="update_database", style={ 'font_family': 'Georgia', 'font-size': '110%', 'backgroundColor': colors['background'], 'align-self': 'center' }), html.P(id="invisible_text", children="placeholder "), html.Div(id="new_issue_list"), ]) @app.callback(Output("update_error_message", "children"),
DATE_MAX = dataDict['sessions']['session_end_at'].max() #.to_pydatetime() ################ Plotly # Layout app.layout = html.Div([ html.Div( [ html.H3('Daily Views and Avg Session Length Date Range:', style={ 'paddingRight': '30px', 'font-family': 'sans-serif', 'color': 'white' }), dcc.DatePickerRange(id='date_picker_1', min_date_allowed=DATE_MIN, max_date_allowed=DATE_MAX, start_date=DATE_MIN, end_date=DATE_MAX), html.Button(id='submit_button_1', n_clicks=0, children='Submit', style={ 'fontSize': 24, 'marginLeft': '30px', 'marginTop': '5px' }) ], style={ 'display': 'inline-block', 'verticalAlign': 'top', 'background-color': '#006aff',
style = {'margin-left' : '85px', 'width' : '550px', 'height' : '400px', 'background-color' : 'white'}),\ href = '#',title = 'Click for Details') ], className = 'w3-cell w3-half'), # column 1 ENDS html.Div(children = [ #column 2 ### SECTION 4 #### html.Div(children = [ html.Div([ html.Div('Past Performance', className = color_style_class+' w3-panel w3-padding w3-margin', style = {'float' : 'left', 'padding-right' : '100px', 'text-shadow' : '1px 1px 0 #444;', 'font-weight' : 'bold'}), html.Div(children = [ html.Div(children = [ dcc.DatePickerRange( id = 'my-datepicker', minimum_nights = 5, start_date_placeholder_text = "From Date", end_date_placeholder_text = "To Date", start_date=from_dt, end_date=to_dt, display_format = 'MMM Do, YY', max_date_allowed = to_dt, min_date_allowed = '2016-01-01', ) ], style = {'width' : '100%'}), ], style = {'margin-left' : '500px'}) ], style = {}) ], className = ''), html.Div(children = [ dcc.Graph( #Graph id = 'my-timeseries', config = {'displayModeBar': False} ) #Graph
meta_tags=[{'name': 'viewport', 'content': 'width=device-width, initial-scale=1.0'}] ) app.layout = dbc. Container([ dbc.Row( dbc.Col(html.H1('PRICE-CHART by date, indicator',className = 'text-center text-primary mb-4'), width = 12) ), # 기간이 datapicker range로 입력됩니다. html.Div(children = 'Input Date'), dcc.DatePickerRange( id='my-date-picker-range', min_date_allowed=date(1995, 8, 5), max_date_allowed=date(2030, 9, 19), initial_visible_month=date(2020, 1, 1), start_date=date(2019, 1, 1), end_date=date(2020, 1, 1), display_format = 'YYYY/MM/DD' ), html.Div(id='output-container-date-picker-range'), html.Hr(), dbc.Row([ # TICKER가 dropdown으로 입력됩니다. dbc.Col([ html.Div(children = 'Input your TICKER'), dcc.Dropdown( id='cell-name-TICKER-column',
dcc.Tab(label='Entry', value='tab-1'), dcc.Tab(label='Dashboard', value='tab-2'), ]), html.Div(id='tabs-content') ]) tab_1 = html.Div([ #row #html.Div(className = "row", children = [html.H1('Data Entry')]), #row html.Div(className="row", children=[ dcc.DatePickerRange( id='dateRange', display_format='Y-M-D', start_date=date(dt.year, dt.month, 1), end_date=date(dt.year, dt.month, calendar.monthrange(dt.year, dt.month)[1])) ]), #row html.Div(className="row", children=[ html.Div(className="two columns", children=[html.H6("Category")]), html.Div(className="four columns", children=[ dcc.Dropdown(id='category', options=[{ 'label': s[0], 'value': str(s[1])
], id='datatable-container'), html.Br(), html.Div([ dbc.Row([ dbc.Col(html.P("Date :"), style=LABEL), dbc.Col(html.P("Start Time (in hours) :"), style=LABEL), dbc.Col(html.P("End Time (in hours) :"), style=LABEL), ]), dbc.Row( [ dbc.Col( dcc.DatePickerRange( id='my-date-picker-range', min_date_allowed=date(1995, 8, 5), max_date_allowed=date(2021, 11, 12), initial_visible_month=date(2015, 1, 1), start_date=date(2020, 1, 1), end_date=date(2020, 1, 2), className="date-picker-custom")), dbc.Col( dcc.Dropdown(id="start-hour-dropdown", options=[{ 'label': str(x), 'value': str(x), 'disabled': False } for x in range(0, 24)], value='0', multi=False, style=DROPDOWN, className="dropdown-custom")), dbc.Col(
dbc.CardTitle("UTM Mapping Logic from Growth Marketing"), # dbc.CardText(dcc.Markdown(utm_mapping)), dbc.CardLink('Link to Solution Document', href="https://docs.google.com/document/d/1vg4B9ctNpLSBts4QnnPrnH4iYL2blv4f_IjiU9iZACo/edit") ], id='mko-collapse', is_open=False ), dbc.Row( [ dbc.Col([ html.H5('Date Selection'), dcc.DatePickerRange( id='mko-date-picker', min_date_allowed=dt(2019, 1, 1), initial_visible_month=dt(2019, 1, 1), end_date="{:%Y-%m-%d}".format(dt.now()), start_date="2019-01-01" # start_date="{:%Y-%m-%d}".format(dt.now()-timedelta(30)) ) ] ), dbc.Col([ html.H5("Time Frequency"), dcc.RadioItems( options=[ {'label': 'Daily', 'value': 'daily'}, {'label': 'Weekly', 'value': 'weekly'}, {'label': 'Month', 'value': 'monthly'} ], value='weekly', labelStyle={'display': 'inline-block',
{ 'label': 'GZ-3701', 'value': 'GZ3701' }, { 'label': 'V-2115', 'value': 'V2115' }, ], value=''), html.Div(children=''' Date Range <br> '''), dcc.DatePickerRange(id='date-picker-range', start_date=dt(2019, 1, 1), min_date_allowed=date(2017, 6, 1), max_date_allowed=date.today(), end_date_placeholder_text='Select a date!'), html.Div(children=''' Time Interval (mins) '''), dcc.Input(placeholder='Enter a value...', type='text', value=''), dcc.RadioItems(options=[{ 'label': 'Pressure', 'value': 'PRE' }, { 'label': 'Temperature', 'value': 'TEM' }], value=''), html.Button(id='button-update', children=['Submit Parameters']),
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(__name__, external_stylesheets=external_stylesheets) app.layout = html.Div(children=[ # формируем html html. H3(children= 'Анализ пользовательского взаимодействия с карточками статей на Яндекс.Дзен' ), html.Label(note), html.Div([ html.Div([ html.Label('Фильтр даты и времени', style={"font-weight": "bold"}), dcc.DatePickerRange( start_date=dash_visits['dt'].dt.date.min(), end_date=dash_visits['dt'].dt.date.max(), display_format='YYYY-MM-DD', id='dt_selector', ) ], className='six columns'), html.Div([ html.Label('Фильтр тем карточек', style={"font-weight": "bold"}), dcc.Dropdown(id='item-topic-dropdown', multi=True, options=[{ 'label': item, 'value': item } for item in dash_visits['item_topic'].unique()], value=dash_visits['item_topic'].unique().tolist()) ], className='six columns')
continents_daywise_df = calculate_continent_daywise(countries_daywise_df) world_daywise_df = calculate_world_daywise(countries_daywise_df) # Find unique values for countries / continents to put in the dropdown list # sorted in the alphabetical order countries = list(set(countries_daywise_df['Country/Region'].tolist())) continents = list(set(countries_daywise_df['WHO Region'].tolist())) countries.sort() continents.sort() date_range_selection = html.Label([ 'Date Range Selection', dcc.DatePickerRange(id='date_selection_range', min_date_allowed=date(2020, 1, 22), max_date_allowed=date(2020, 7, 27), initial_visible_month=date(2020, 1, 22), start_date=date(2020, 1, 22), end_date=date(2020, 7, 27), stay_open_on_select=True, updatemode='bothdates') ]) options_selection = html.Label([ 'Display Data', dcc.RadioItems(id='select_options', options=[ { 'label': 'Absolute', 'value': 'Absolute' }, { 'label': 'Per Capita',
#Filter pt 1 html.Div([ html.Div([ html.H5( children='Filters by Date:', style = {'text-align' : 'left', 'color' : corporate_colors['medium-blue-grey']} ), #Date range picker html.Div(['Select a date range: ', dcc.DatePickerRange( id='date-picker-sales', start_date = min_dt_str, end_date = max_dt_str, min_date_allowed = min_dt, max_date_allowed = max_dt, start_date_placeholder_text = 'Start date', display_format='DD-MMM-YYYY', first_day_of_week = 1, end_date_placeholder_text = 'End date', style = {'font-size': '12px','display': 'inline-block', 'border-radius' : '2px', 'border' : '1px solid #ccc', 'color': '#333', 'border-spacing' : '0', 'border-collapse' :'separate'}) ], style = {'margin-top' : '5px'} ) ], style = {'margin-top' : '10px', 'margin-bottom' : '5px', 'text-align' : 'left', 'paddingLeft': 5}) ],
html.Div([ html.H3('Select Stocks:', style={'paddingRight': '20px'},className='two columns'), dcc.Dropdown(id='labels',value='AAPL',options=[{'label':i,'value':i} for i in stocks])], style={'verticalAlign': 'top','width':'48%','display': 'inline-block'}), html.Br(), html.Br(), html.Div([ html.H3('Select statistics',style={'paddingLeft': '20px'}), dcc.Dropdown(id='statistic',value='return',options=[{'label':i,'value':i} for i in stats_choice])], style={'verticalAlign':'top','width':'48%','display':'inline-block'}), html.Div([ html.H3('Select interval'), dcc.DatePickerRange(id='Date',min_date_allowed=dt.datetime(2015,10,20),max_date_allowed=dt.datetime.today(),\ start_date=dt.datetime(2015,10,20),end_date=dt.datetime.today())], style={'verticalAlign':'top','display':'inline-block'}), html.Div([ html.Button(id='submit_button',n_clicks=0,children='Submit',style={'fontSize': 18})], style={'display': 'inline-block'}), html.Br(), html.Br(), html.Div([dcc.Graph(id="trend", style={'border-style': 'solid'})]), html.Br(), html.Div([dcc.Graph(id="movingaverage", style={'border-style': 'solid'})]), html.Br(),
def __init__(self, django=True, *args, **kwargs): super(TrackingDashboard, self).__init__(django=django, *args, **kwargs) pageview_stats = Pageview.objects.stats() self.app.layout = html.Div( html.Div([ dcc.Checklist(id='clear_bots', options=[ { 'label': 'No Bot Keyword', 'value': 'bot' }, { 'label': 'No Agent Keyword', 'value': 'agent' }, { 'label': 'No http Keyword', 'value': 'http' }, { 'label': 'No Trident Keyword', 'value': 'Trident' }, ], value=['bot', 'agent', 'http', 'Trident']), dcc.Checklist(id='mouse', options=[ { 'label': 'Only with mouse movements', 'value': 'movement' }, { 'label': 'Only with mouse clicks', 'value': 'click' }, ], value=[]), # html.Div( # [html.P('Filter Agents (use comma to separate inputs)'), # dcc.Input(id='remove_agents', # options=[{'label': loc, 'value': loc} for loc in pageview_stats['geo_location'].keys()], # multi=True)] # ), dcc.DatePickerRange( id='date-picker-range', # min_date_allowed=dt(1995, 8, 5), # max_date_allowed=dt(2017, 9, 19), # initial_visible_month=dt(2017, 8, 5), # end_date=dt(2017, 8, 25).date() ), html.Div([ html.P('Remove Locations'), dcc.Dropdown( id='remove_locations', options=[{ 'label': loc, 'value': loc } for loc in pageview_stats['geo_location'].keys()], multi=True) ]), html.Button('update', id='hidden_update'), html.Div(id='geo_map'), ])) @self.app.callback(Output('geo_map', 'children'), [Input('hidden_update', 'n_clicks')], [ State('clear_bots', 'value'), State('remove_locations', 'value'), State('date-picker-range', 'start_date'), State('date-picker-range', 'end_date'), State('mouse', 'value') ]) def update_graph(hidden_update, clear_bots, remove_locations, start_date, end_date, mouse_behavior): if end_date is None and start_date is not None: end_date = ( datetime.datetime.strptime(start_date, '%Y-%m-%d') + datetime.timedelta(days=1)).strftime('%Y-%m-%d') pageview_stats = Pageview.objects.stats( start_date=start_date, end_date=end_date, filter_agents=clear_bots, remove_locations=remove_locations, mouse_behavior=mouse_behavior) # a = 5 fig = go.Figure() # now loop over every geo_location (execpt for None) and add that spot to the map location_amount = len(pageview_stats['geo_location'].keys()) for location, location_stats in pageview_stats[ 'geo_location'].items(): if location is not 'None': fig.add_trace( go.Scattergeo(lat=[location_stats['lat']], lon=[location_stats['lon']], text=location + '<br> All Time Views: ' + str(location_stats['count']), marker={ 'size': np.log(location_stats['count']) / np.log(location_amount) * 20, 'sizemode': 'area' }, showlegend=False)) fig.update_layout( title_text='World Map of 2D Trends Ping Locations', height=700) geo_map = dcc.Graph(figure=fig) # now create the table table = dash_table.DataTable( id='table', columns=[{ 'name': i, 'id': i } for i in pageview_stats['url_stats'][0]['visitors'] [0].keys()], data=pageview_stats['url_stats'][0]['visitors'], style_table={'overflowX': 'auto'}, filter_action="native", sort_action="native", sort_mode="multi", # column_selectable="single", row_selectable="multi", row_deletable=True, selected_columns=[], selected_rows=[], page_action="native", page_current=0, page_size=20, ) stats = html.Div([ 'total count: {0}'.format( pageview_stats['url_stats'][0]['total_count']), ' unique count: {0}'.format( pageview_stats['url_stats'][0]['unique_count']) ]) # add the daily views plot daily_views = dcc.Graph(figure=go.Figure( [ go.Scatter(x=list(pageview_stats['daily views'].keys()), y=list(pageview_stats['daily views'].values())) ], layout=go.Layout(title='Daily Views', xaxis={'title': 'Date'}, yaxis={'title': 'Total Views'}))) return [stats, geo_map, daily_views, table]
def generate_control_card(): return html.Div( id="control-card", # controls in two columns children=[ html.B("Dashboard controls"), html.Div( id="two column controls", children=[ html.P("Area of panels to install (m\u00b2):"), dcc.Input(id='input-area', value=settings.default_area, type='number'), # default is 5m2 html.Br(), html.Br(), html.P("Cost of panels ($/m\u00b2):"), dcc.Input(id='input-panelcost', value=settings.default_panelcost, type='number'), html.Br(), html.Br(), html.P("Feed in tariff (c/kWh):"), dcc.Input(id='input-feedin', value=settings.default_feedin, type='number'), html.Br(), html.Br(), html.P("Off peak tariff (c/kWh):"), dcc.Input(id='input-offpeak', value=settings.default_offpeak, type='number'), html.Br(), html.Br(), html.P("Shoulder tariff (c/kWh):"), dcc.Input(id='input-shoulder', value=settings.default_shoulder, type='number'), html.Br(), html.Br(), html.P("Peak tariff (c/kWh):"), dcc.Input(id='input-peak', value=settings.default_peak, type='number'), html.Br(), html.Br(), ], style={'columnCount': 2}), # date range control in single column html.P("Select date range:"), dcc.DatePickerRange(id="date-picker-select", start_date=settings.default_startdate, end_date=settings.default_enddate, min_date_allowed=dt(2018, 1, 1), max_date_allowed=dt(2018, 12, 31), initial_visible_month=dt(2018, 1, 1), display_format='DD/MM/YY', start_date_placeholder_text='DD/MM/YY'), html.Br(), html.Br(), html.Div( id="reset-btn-outer", children=html.Button(id="reset-btn", children="Reset all", n_clicks=0), ), ], )
import dash import dash_core_components as dcc import dash_bootstrap_components as dbc import dash_html_components as html from dash.dependencies import Input, Output from datetime import datetime as dt datepicker_input = dbc.FormGroup([ dbc.Label("DateRange ", html_for="datepickerinp", width=3), dbc.Col(dcc.DatePickerRange( end_date=dt(2017, 6, 21, 23, 59, 59, 999999), display_format='MMM Do, YY', start_date_placeholder_text='MMM Do, YY', id='datepickerinp', ), width=8) ], row=True, className='datepickker-input') stock_name_inp = dbc.FormGroup([ dbc.Label("Ticker ", width=3), dbc.Col(dbc.Input(placeholder="TickerName...", type="text"), width=8) ], row=True) fileupload_input = dbc.FormGroup([ dcc.Upload(id='upload-data', children=html.Div(['Drag and Drop or ', html.A('Select Files')]), style={
style={ 'textAlign': 'right', "background": "black", } ), html.Div(['Date selector for graphs', dcc.DatePickerRange( id='date-input', stay_open_on_select=False, min_date_allowed=datetime(2013, 4, 28), max_date_allowed=datetime.now(), initial_visible_month=datetime.now(), start_date=datetime(2019, 1, 1), end_date=datetime.now(), number_of_months_shown=2, month_format='MMMM,YYYY', display_format='YYYY-MM-DD', style={ 'color': '#11ff3b', 'font-size': '18px', 'margin': 0, 'padding': '8px', 'background': 'yellow', } ), 'Select coin here', dcc.Dropdown(id='dropdown', options=[{'label': i, 'value': i} for i in coin_list], value='bitcoin', optionHeight=10, style={
def layout(app): app.layout = \ html.Div( className="Full_view", children=[ html.Div(id="dummy_id_for_default"), dcc.Interval(id='data_updater', interval=60000 , n_intervals=0), html.Div( className="left_half_of_view", children=[ html.Div( className="card-background-dropdown-timestamp", children=[ html.Div( className="dropdown-below-timestamp", children=[ html.H4(html.Pre(id="latest_update")), html.Pre("Pick a gateway"), dcc.Dropdown( id='dropdown_below_timestamp', clearable=False ) ], ), html.Div( className="datepicker", children=[ html.Pre("Pick a date:"), dcc.DatePickerRange( id='datepicker', ) ], ), html.Div( className="hour-selector", children=[ html.Pre("Pick a specific interval:"), dcc.Dropdown( id='hour_selector', multi=True, clearable=True, options = [{"value":i, "label":i} for i in range(0,24)], ) ], ), ] ), html.Div( className="card-background-circular-graph", children=[ html.Div( className="circular-pie-chart", children=[ dcc.Graph( id="gps_success_circular_graph" ) ], ), ], ), ] ), html.Div( className="right_side_of_view", children=[ html.Div( className="card-datatable-ttb", children=[ html.Div( className="datatable", children=[ dash_table.DataTable( id='datatable', #style_as_list_view=True, fixed_rows={ 'headers': True }, style_table={ 'height': 400, 'overflowX': 'auto', }, style_cell={ 'textAlign': 'center', 'overflow': 'hidden', 'minWidth': '80px', 'width': '80px', 'maxWidth': '180px', } ) ], ), ] ), html.Div( className="graph-card", children=[ html.Div( className="map_for_endpoint_transmissions", children=[ dcc.RadioItems( id="map_legend_picker", options=[ {'label': 'RSSI', 'value': 'rssi'}, {'label': 'SNR', 'value': 'loRaSNR'}, {'label': 'Datarate', 'value': 'datarate'}, ], value='rssi', ) ] ), html.Div( className="map_for_endpoint_transmissions", children=[ dcc.Graph( id="full_round_bar_chart", ) ] ) ] ) ], ), ] ) return app
dcc.Dropdown( id='my_ticker_symbol', options=options, value=['TSLA'], multi=True ) ], style={'display':'inline-block', 'verticalAlign':'top', 'width':'30%'}), html.Div( [ html.H3('Select start and end dates:'), dcc.DatePickerRange( id='my_date_picker', min_date_allowed=datetime(2015, 1, 1), max_date_allowed=datetime.today(), start_date=datetime(2018, 1, 1), end_date=datetime.today() ) ], style={'display':'inline-block'}), html.Div( [ html.Button( id='submit-button', n_clicks=0, children='Submit', style={'fontSize':24, 'marginLeft':'30px'} ), ],
def load_wrap(children): return dcc.Loading(type="default", fullscreen=True, style={'backgroundColor': 'rgba(0,0,0,0.5)'}, children=children) date_range_col = dbc.Col( dbc.FormGroup([ dbc.Label("Date range", html_for="date-range-filter"), html.Br(), dcc.DatePickerRange(id='date-range-filter', display_format='YYYY-MM-DD', min_date_allowed=config_min_date, max_date_allowed=config_max_date, start_date=config_min_date, end_date=config_max_date), ]), width=3, ) mode_col = dbc.Col( dbc.FormGroup([ dbc.Label("Countries are", html_for="polarity-selector"), dbc.Select(id='mode-selector', options=[ { 'label': 'Producing news', 'value': 'produce' },