File size: 3,970 Bytes
21b66b5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | 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:
# ==================================================
# Global header (always visible)
# ==================================================
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.Image(LOGOS["himmapan"], height=80, show_label=False)
gr.Markdown(
"""
# Thotsakan Statistics
*Probability and Statistics Interactive Laboratory*
"""
)
# ==================================================
# Main application tabs
# ==================================================
with gr.Tabs():
# -------------------------
# Home
# -------------------------
with gr.Tab("๐ Home"):
gr.Markdown("What is Himmapan lab. Its goal, its vision, products.")
gr.Markdown("What is Thotsakan Statistics. Links to repository.")
# -------------------------
# Data
# -------------------------
with gr.Tab("๐ Data"):
build_data_tab(state)
# -------------------------
# Probability
# -------------------------
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.")
# -------------------------
# Estimation
# -------------------------
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)
# -------------------------
# Hypothesis Testing
# -------------------------
with gr.Tab("๐งช Hypothesis Testing"):
build_hypothesis_tab(state)
# -------------------------
# Linear Regression
# -------------------------
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
|