Open alexbeo opened 6 years ago
@alexbeo I'm sorry, I don't follow. What is the issue?
The code from the example that worked before does not work.
For some reason, the filename and last_modified element is missing in the list. Previously, such an error did not arise and everything worked.
import base64 import datetime import io
import dash from dash.dependencies import Input, Output import dash_core_components as dcc import dash_html_components as html import dash_table_experiments as dt
import pandas as pd
BASE_NAMES = ('Date', 'Open', 'High', 'Low', 'Close', 'Vol', 'Z') date_col = BASE_NAMES[0]
app = dash.Dash()
app.scripts.config.serve_locally = True
app.layout = html.Div([ html.H1('Программа анализа финансовых временных рядов', style={ 'textAlign': 'center', 'margin': '10px' } ), dcc.Upload( id='upload-data', children=html.Div([ 'Load File ', html.A(' File Open') ]), style={ 'width': '100%', 'height': '60px', 'lineHeight': '60px', 'borderWidth': '1px', 'borderStyle': 'dashed', 'borderRadius': '5px', 'textAlign': 'center', 'margin': '10px' },
Allow multiple files to be uploaded
])
def parse_contents(contents, filename, date): content_type, content_string = contents.split(',')
@app.callback(Output('output-data-upload', 'children'), [Input('upload-data', 'contents'), Input('upload-data', 'filename'), Input('upload-data', 'last_modified')]) def update_output(list_of_contents, list_of_names, list_of_dates): if list_of_contents is not None: children = [parse_contents(c, n, d) for c, n, d in zip(list_of_contents, list_of_names, list_of_dates)] return children
app.css.append_css({ 'external_url': 'https://codepen.io/chriddyp/pen/bWLwgP.css' })
if name == 'main': app.run_server(debug=True)
dash.exceptions.NonExistantPropException: Attempting to assign a callback with the property "filename" but the component "upload-data" doesn't have "filename" as a property.
Here is a list of the available properties in "upload-data": ['children', 'id', 'contents', 'accept', 'disabled', 'disable_click', 'max_size', 'min_size', 'multiple', 'className', 'className_active', 'className_reject', 'className_disabled', 'style', 'style_active', 'style_reject', 'style_disabled']