Beam2513 commited on
Commit
21b66b5
ยท
verified ยท
1 Parent(s): ddb1b37

Upload 127 files

Browse files
Files changed (3) hide show
  1. app.py +2 -2
  2. requirements.txt +10 -10
  3. ui/layout.py +108 -110
app.py CHANGED
@@ -1,8 +1,8 @@
1
  from ui.layout import build_layout
2
 
3
  def main():
4
- app = build_layout()
5
- app.launch(share=True)
6
 
7
  if __name__ == "__main__":
8
  main()
 
1
  from ui.layout import build_layout
2
 
3
  def main():
4
+ app, theme, css = build_layout()
5
+ app.launch(share=True, theme=theme, css=css)
6
 
7
  if __name__ == "__main__":
8
  main()
requirements.txt CHANGED
@@ -1,10 +1,10 @@
1
- gradio<5.0.0
2
- pandas
3
- numpy
4
- matplotlib
5
- seaborn
6
- scipy
7
- statsmodels
8
- openpyxl
9
- Pillow
10
- pingouin
 
1
+ gradio
2
+ pandas
3
+ numpy
4
+ matplotlib
5
+ seaborn
6
+ scipy
7
+ statsmodels
8
+ openpyxl
9
+ Pillow
10
+ pingouin
ui/layout.py CHANGED
@@ -1,110 +1,108 @@
1
- import gradio as gr
2
-
3
- from state.app_state import AppState
4
- from ui.styles import DATA_SELECTOR_CSS
5
- from ui.assets import LOGOS
6
-
7
- from ui.tabs.data_tab import build as build_data_tab
8
- from ui.tabs.estimation.descriptive_tab import build as build_descriptive_tab
9
- from ui.tabs.estimation.inference_tab import build as build_inference_tab
10
- from ui.tabs.estimation.graphical_tab import build as build_graphical_tab
11
- from ui.tabs.hypothesis_testing_tab import build as build_hypothesis_tab
12
- from ui.tabs.linear_regression_tab import build as build_linear_regression_tab
13
-
14
-
15
- def build_layout():
16
- """
17
- Global application layout.
18
-
19
- Responsibilities:
20
- - Instantiate AppState once
21
- - Apply theme and CSS globally
22
- - Render persistent header (logos + title)
23
- - Define main navigation tabs
24
- """
25
-
26
- state = AppState()
27
-
28
- with gr.Blocks(
29
- title="Thotsakan Statistics",
30
- theme=gr.themes.Soft(),
31
- css=DATA_SELECTOR_CSS,
32
- ) as demo:
33
-
34
- # ==================================================
35
- # Global header (always visible)
36
- # ==================================================
37
- with gr.Row(equal_height=True):
38
- gr.Image(LOGOS["thotsakan"], height=80, show_label=False)
39
- gr.Image(LOGOS["cmkl"], height=80, show_label=False)
40
- gr.Image(LOGOS["aice"], height=80, show_label=False)
41
- #gr.Image(LOGOS["himmapan"], height=80, show_label=False, show_download_button=False, show_fullscreen_button=False)
42
-
43
- gr.Markdown(
44
- """
45
- # Thotsakan Statistics
46
- *Probability and Statistics Interactive Laboratory*
47
- """
48
- )
49
-
50
- # ==================================================
51
- # Main application tabs
52
- # ==================================================
53
- with gr.Tabs():
54
-
55
- # -------------------------
56
- # Home
57
- # -------------------------
58
- with gr.Tab("๐Ÿ  Home"):
59
- gr.Markdown("What is Himmapan lab. Its goal, its vision, products.")
60
- gr.Markdown("What is Thotsakan Statistics. Links to repository.")
61
-
62
- # -------------------------
63
- # Data
64
- # -------------------------
65
- with gr.Tab("๐Ÿ“ Data"):
66
- build_data_tab(state)
67
-
68
- # -------------------------
69
- # Probability
70
- # -------------------------
71
- with gr.Tab("๐ŸŽฒ Probability"):
72
- with gr.Tabs():
73
- with gr.Tab("๐Ÿ“œ Common Distributions"):
74
- gr.Markdown("๐Ÿšง Building.")
75
-
76
- with gr.Tab("โœ๏ธ Custom Distribution"):
77
- gr.Markdown("๐Ÿšง Building.")
78
-
79
- with gr.Tab("๐Ÿค Approximations"):
80
- gr.Markdown("๐Ÿšง Building.")
81
-
82
- # -------------------------
83
- # Estimation
84
- # -------------------------
85
- with gr.Tab("๐Ÿ“ Estimation"):
86
- with gr.Tabs():
87
- with gr.Tab("๐Ÿงฎ Descriptive Statistics"):
88
- build_descriptive_tab(state)
89
-
90
- with gr.Tab("๐Ÿ’ญ Statistical Inference"):
91
- build_inference_tab(state)
92
-
93
- with gr.Tab("๐Ÿ“Š Graphical Analysis"):
94
- build_graphical_tab(state)
95
-
96
- # -------------------------
97
- # Hypothesis Testing
98
- # -------------------------
99
- with gr.Tab("๐Ÿงช Hypothesis Testing"):
100
- build_hypothesis_tab(state)
101
-
102
- # -------------------------
103
- # Linear Regression
104
- # -------------------------
105
- with gr.Tab("๐Ÿ“ˆ Linear Regression"):
106
- build_linear_regression_tab(state)
107
-
108
- gr.Markdown("### ๐Ÿค“ Developed by Himmapan Lab at CMKL University, version 5.0.0, February 2026.")
109
-
110
- return demo
 
1
+ import gradio as gr
2
+
3
+ from state.app_state import AppState
4
+ from ui.styles import DATA_SELECTOR_CSS
5
+ from ui.assets import LOGOS
6
+
7
+ from ui.tabs.data_tab import build as build_data_tab
8
+ from ui.tabs.estimation.descriptive_tab import build as build_descriptive_tab
9
+ from ui.tabs.estimation.inference_tab import build as build_inference_tab
10
+ from ui.tabs.estimation.graphical_tab import build as build_graphical_tab
11
+ from ui.tabs.hypothesis_testing_tab import build as build_hypothesis_tab
12
+ from ui.tabs.linear_regression_tab import build as build_linear_regression_tab
13
+
14
+
15
+ def build_layout():
16
+ """
17
+ Global application layout.
18
+
19
+ Responsibilities:
20
+ - Instantiate AppState once
21
+ - Apply theme and CSS globally
22
+ - Render persistent header (logos + title)
23
+ - Define main navigation tabs
24
+ """
25
+
26
+ state = AppState()
27
+
28
+ with gr.Blocks(
29
+ title="Thotsakan Statistics",
30
+ ) as demo:
31
+
32
+ # ==================================================
33
+ # Global header (always visible)
34
+ # ==================================================
35
+ with gr.Row(equal_height=True):
36
+ gr.Image(LOGOS["thotsakan"], height=80, show_label=False)
37
+ gr.Image(LOGOS["cmkl"], height=80, show_label=False)
38
+ gr.Image(LOGOS["aice"], height=80, show_label=False)
39
+ #gr.Image(LOGOS["himmapan"], height=80, show_label=False)
40
+
41
+ gr.Markdown(
42
+ """
43
+ # Thotsakan Statistics
44
+ *Probability and Statistics Interactive Laboratory*
45
+ """
46
+ )
47
+
48
+ # ==================================================
49
+ # Main application tabs
50
+ # ==================================================
51
+ with gr.Tabs():
52
+
53
+ # -------------------------
54
+ # Home
55
+ # -------------------------
56
+ with gr.Tab("๐Ÿ  Home"):
57
+ gr.Markdown("What is Himmapan lab. Its goal, its vision, products.")
58
+ gr.Markdown("What is Thotsakan Statistics. Links to repository.")
59
+
60
+ # -------------------------
61
+ # Data
62
+ # -------------------------
63
+ with gr.Tab("๐Ÿ“ Data"):
64
+ build_data_tab(state)
65
+
66
+ # -------------------------
67
+ # Probability
68
+ # -------------------------
69
+ with gr.Tab("๐ŸŽฒ Probability"):
70
+ with gr.Tabs():
71
+ with gr.Tab("๐Ÿ“œ Common Distributions"):
72
+ gr.Markdown("๐Ÿšง Building.")
73
+
74
+ with gr.Tab("โœ๏ธ Custom Distribution"):
75
+ gr.Markdown("๐Ÿšง Building.")
76
+
77
+ with gr.Tab("๐Ÿค Approximations"):
78
+ gr.Markdown("๐Ÿšง Building.")
79
+
80
+ # -------------------------
81
+ # Estimation
82
+ # -------------------------
83
+ with gr.Tab("๐Ÿ“ Estimation"):
84
+ with gr.Tabs():
85
+ with gr.Tab("๐Ÿงฎ Descriptive Statistics"):
86
+ build_descriptive_tab(state)
87
+
88
+ with gr.Tab("๐Ÿ’ญ Statistical Inference"):
89
+ build_inference_tab(state)
90
+
91
+ with gr.Tab("๐Ÿ“Š Graphical Analysis"):
92
+ build_graphical_tab(state)
93
+
94
+ # -------------------------
95
+ # Hypothesis Testing
96
+ # -------------------------
97
+ with gr.Tab("๐Ÿงช Hypothesis Testing"):
98
+ build_hypothesis_tab(state)
99
+
100
+ # -------------------------
101
+ # Linear Regression
102
+ # -------------------------
103
+ with gr.Tab("๐Ÿ“ˆ Linear Regression"):
104
+ build_linear_regression_tab(state)
105
+
106
+ gr.Markdown("### ๐Ÿค“ Developed by Himmapan Lab at CMKL University, version 5.0.0, February 2026.")
107
+
108
+ return demo, gr.themes.Soft(), DATA_SELECTOR_CSS