import pandas as pd
import vizro.plotly.express as px
from vizro import Vizro
import vizro.models as vm
# URL of the CSV data
url = 'https://sdmx.data.unicef.org/ws/public/sdmxapi/rest/data/ECARO,ECACID,1.0/all?format=csv&labels=both'
# Read the CSV data from the URL and store it in a DataFrame
df = pd.read_csv(url, low_memory=False)
# Create a sample plotly figure
fig = px.scatter(df, x="OBS_Value", y="Indicator", title="Sample Plot")
# Define the components to be displayed on the page
components = [
vm.Graph(figure=fig)
]
# Create the page with components
page = vm.Page(
title="ECACID",
components=components
)
# Create the dashboard with the page
dashboard = vm.Dashboard(pages=[page])
# Build and run the Vizro app
Vizro().build(dashboard).run()