Black Lives Matter. Please consider donating to Black Girls Code today.

Displaying JSON data in a component [solved]

Thought this might be of some help to others. Here is an exchange me and Chris had regarding the topic of creating a simple API that dumps a JSON using Dash.

Hi Chris

I’m fairly new to plotly and Dash but just looking through the User Guide and working through the examples it seems like Dash is pretty dang flexible.

My question is:
Is it possible to create a simple API that updates by reading a new file using Interval and just returns a JSON using json.dump? I’m interested in creating a nifty dashboard eventually but just wanted to start by dumping the JSON.

I hope my question is clear and thank you in advance.

Thanks for reaching out! This is possible - you can update the children property of a Pre element.

If you are working with JSON, then it would be better to validate JSON string.

I am using these tool, which helps me to do that.