PMSB
January 26, 2024, 9:53pm
1
Can I upload data into Dash from my desktop using a json file?
AIMPED
January 26, 2024, 10:10pm
2
Hi @PMSB !
Sure, you can use the dcc.Upload()
component.
PMSB
January 26, 2024, 10:27pm
3
This link shows upload functionality for csv file. Can you please share the documentation for json format, where I can use the columns of that file dynamically for plotting a graph?
AIMPED
January 26, 2024, 11:13pm
4
Here is an example where a json
gets uploaded and then is used to create a plotly
figure object.
Hi,
Not sure if it is too late, but I have a working example that can help you. In this example, I can upload a plotly figure from json and regenerate the graph in the callback:
"""
Using upload to regenerate plotly figures from JSON
"""
import base64
import json
from dash import Dash, html, dcc, Input, Output, State, callback
from dash.exceptions import PreventUpdate
# Export plot as json
# data = px.scatter(px.data.iris(), x="sepal_length", y="petal_length", color="species").to_json()
# wi…
1 Like