| import gradio as gr
|
|
|
| from state.app_state import AppState
|
| from ui.styles import DATA_SELECTOR_CSS
|
| from ui.assets import LOGOS
|
|
|
| from ui.tabs.data_tab import build as build_data_tab
|
| from ui.tabs.estimation.descriptive_tab import build as build_descriptive_tab
|
| from ui.tabs.estimation.inference_tab import build as build_inference_tab
|
| from ui.tabs.estimation.graphical_tab import build as build_graphical_tab
|
| from ui.tabs.hypothesis_testing_tab import build as build_hypothesis_tab
|
| from ui.tabs.linear_regression_tab import build as build_linear_regression_tab
|
|
|
|
|
| def build_layout():
|
| """
|
| Global application layout.
|
|
|
| Responsibilities:
|
| - Instantiate AppState once
|
| - Apply theme and CSS globally
|
| - Render persistent header (logos + title)
|
| - Define main navigation tabs
|
| """
|
|
|
| state = AppState()
|
|
|
| with gr.Blocks(
|
| title="Thotsakan Statistics",
|
| ) as demo:
|
|
|
|
|
|
|
|
|
| with gr.Row(equal_height=True):
|
| gr.Image(LOGOS["thotsakan"], height=80, show_label=False)
|
| gr.Image(LOGOS["cmkl"], height=80, show_label=False)
|
| gr.Image(LOGOS["aice"], height=80, show_label=False)
|
|
|
|
|
| gr.Markdown(
|
| """
|
| # Thotsakan Statistics
|
| *Probability and Statistics Interactive Laboratory*
|
| """
|
| )
|
|
|
|
|
|
|
|
|
| with gr.Tabs():
|
|
|
|
|
|
|
|
|
| with gr.Tab("๐ Home"):
|
| gr.Markdown("What is Himmapan lab. Its goal, its vision, products.")
|
| gr.Markdown("What is Thotsakan Statistics. Links to repository.")
|
|
|
|
|
|
|
|
|
| with gr.Tab("๐ Data"):
|
| build_data_tab(state)
|
|
|
|
|
|
|
|
|
| with gr.Tab("๐ฒ Probability"):
|
| with gr.Tabs():
|
| with gr.Tab("๐ Common Distributions"):
|
| gr.Markdown("๐ง Building.")
|
|
|
| with gr.Tab("โ๏ธ Custom Distribution"):
|
| gr.Markdown("๐ง Building.")
|
|
|
| with gr.Tab("๐ค Approximations"):
|
| gr.Markdown("๐ง Building.")
|
|
|
|
|
|
|
|
|
| with gr.Tab("๐ Estimation"):
|
| with gr.Tabs():
|
| with gr.Tab("๐งฎ Descriptive Statistics"):
|
| build_descriptive_tab(state)
|
|
|
| with gr.Tab("๐ญ Statistical Inference"):
|
| build_inference_tab(state)
|
|
|
| with gr.Tab("๐ Graphical Analysis"):
|
| build_graphical_tab(state)
|
|
|
|
|
|
|
|
|
| with gr.Tab("๐งช Hypothesis Testing"):
|
| build_hypothesis_tab(state)
|
|
|
|
|
|
|
|
|
| with gr.Tab("๐ Linear Regression"):
|
| build_linear_regression_tab(state)
|
|
|
| gr.Markdown("### ๐ค Developed by Himmapan Lab at CMKL University, version 5.0.0, February 2026.")
|
|
|
| return demo, gr.themes.Soft(), DATA_SELECTOR_CSS
|
|
|