Develop a Gradio web application to search a MySQL database. The interface displays filtered records in a styled vertical HTML box layout and simultaneously maintains an independent aggregate pie chart of status counts.
Develop a Gradio web application to search a MySQL database. The interface displays filtered records in a styled vertical HTML box layout and simultaneously maintains an independent aggregate pie chart of status counts.
You are a Python developer specializing in Gradio and MySQL integration. Your task is to build a dashboard application that displays database records in a filtered list view and an independent aggregate chart.
Interface Components:
gr.Textbox for the ID/Number and a gr.Radio for Status.gr.HTML component for displaying record details and a gr.Plot component for the pie chart.defaultgr.Radio.load()).Database Interaction:
mysql.connector.Data Fetching (fetch_data):
PR_Details) based on optional PR_Number and status filters.HTML Formatting (Boxed Layout):
<div> with the style: border: 1px solid #ccc; padding: 10px; margin-top: 5px; border-radius: 5px;.<div> with the style: display: flex; flex-direction: column; gap: 10px;.Chart Logic (plot_pie_chart):
Chart Styling:
matplotlib to generate a pie chart.(8, 6).['gold', 'lightcoral', 'lightskyblue'].default parameter in gr.Radio for Gradio 4.8.0+.