staticdash 0.3.4__py3-none-any.whl → 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- staticdash/assets/css/style.css +62 -50
- staticdash/dashboard.py +25 -14
- {staticdash-0.3.4.dist-info → staticdash-0.4.1.dist-info}/METADATA +1 -1
- staticdash-0.4.1.dist-info/RECORD +8 -0
- staticdash-0.3.4.dist-info/RECORD +0 -8
- {staticdash-0.3.4.dist-info → staticdash-0.4.1.dist-info}/WHEEL +0 -0
- {staticdash-0.3.4.dist-info → staticdash-0.4.1.dist-info}/top_level.txt +0 -0
staticdash/assets/css/style.css
CHANGED
@@ -1,47 +1,45 @@
|
|
1
1
|
body {
|
2
2
|
margin: 0;
|
3
3
|
font-family: sans-serif;
|
4
|
-
/* background-color: #f9f9f9; */
|
5
4
|
background-color: #ffffff;
|
6
5
|
color: #333;
|
6
|
+
display: flex;
|
7
|
+
min-height: 100vh;
|
7
8
|
}
|
8
9
|
|
10
|
+
/* Sidebar */
|
9
11
|
#sidebar {
|
10
|
-
position: fixed;
|
11
|
-
top: 0;
|
12
|
-
left: 0;
|
13
12
|
width: 240px;
|
14
|
-
|
15
|
-
|
16
|
-
padding: 20px
|
13
|
+
background-color: #ffffff;
|
14
|
+
border-right: 1px solid #ccc;
|
15
|
+
padding: 20px;
|
17
16
|
box-sizing: border-box;
|
18
17
|
overflow-y: auto;
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
width: 6px;
|
25
|
-
}
|
26
|
-
|
27
|
-
#sidebar::-webkit-scrollbar-track {
|
28
|
-
background: #2c3e50;
|
29
|
-
}
|
30
|
-
|
31
|
-
#sidebar::-webkit-scrollbar-thumb {
|
32
|
-
background-color: #888;
|
33
|
-
border-radius: 3px;
|
18
|
+
position: sticky;
|
19
|
+
top: 0;
|
20
|
+
height: 100vh;
|
21
|
+
display: flex;
|
22
|
+
flex-direction: column;
|
34
23
|
}
|
35
24
|
|
25
|
+
/* Sidebar header */
|
36
26
|
#sidebar h1 {
|
37
|
-
color: #
|
27
|
+
color: #2c3e50;
|
38
28
|
font-size: 20px;
|
39
29
|
margin-bottom: 20px;
|
40
30
|
}
|
41
31
|
|
32
|
+
/* Nav links container */
|
33
|
+
#sidebar .nav-links {
|
34
|
+
flex-grow: 1;
|
35
|
+
display: flex;
|
36
|
+
flex-direction: column;
|
37
|
+
}
|
38
|
+
|
39
|
+
/* Nav links */
|
42
40
|
.nav-link {
|
43
41
|
display: block;
|
44
|
-
color: #
|
42
|
+
color: #2c3e50;
|
45
43
|
text-decoration: none;
|
46
44
|
margin: 10px 0;
|
47
45
|
font-weight: bold;
|
@@ -51,8 +49,7 @@ body {
|
|
51
49
|
}
|
52
50
|
|
53
51
|
.nav-link:hover {
|
54
|
-
color: #
|
55
|
-
background-color: #34495e;
|
52
|
+
background-color: #ecf0f1;
|
56
53
|
}
|
57
54
|
|
58
55
|
.nav-link.active {
|
@@ -60,16 +57,14 @@ body {
|
|
60
57
|
background-color: #1abc9c;
|
61
58
|
}
|
62
59
|
|
60
|
+
/* Sidebar footer */
|
63
61
|
#sidebar-footer {
|
64
|
-
position: fixed;
|
65
|
-
bottom: 20px;
|
66
|
-
left: 20px;
|
67
|
-
width: 200px;
|
68
62
|
font-size: 12px;
|
69
63
|
color: #7f8c8d;
|
70
64
|
text-align: center;
|
71
65
|
line-height: 1.4;
|
72
|
-
|
66
|
+
padding-top: 20px;
|
67
|
+
border-top: 1px solid #ccc;
|
73
68
|
}
|
74
69
|
|
75
70
|
#sidebar-footer a {
|
@@ -81,14 +76,31 @@ body {
|
|
81
76
|
text-decoration: underline;
|
82
77
|
}
|
83
78
|
|
84
|
-
|
85
|
-
|
79
|
+
/* Wrapper */
|
80
|
+
#wrapper {
|
81
|
+
flex: 1;
|
82
|
+
background-color: #ffffff;
|
83
|
+
overflow-x: hidden;
|
84
|
+
display: flex;
|
85
|
+
flex-direction: column;
|
86
|
+
}
|
87
|
+
|
88
|
+
#wrapper-inner {
|
89
|
+
max-width: 2200px;
|
90
|
+
margin: 0 auto;
|
86
91
|
padding: 20px;
|
87
92
|
box-sizing: border-box;
|
88
93
|
}
|
89
94
|
|
95
|
+
#content {
|
96
|
+
width: 100%;
|
97
|
+
box-sizing: border-box;
|
98
|
+
}
|
99
|
+
|
90
100
|
.page-section {
|
91
101
|
display: none;
|
102
|
+
max-width: 100%;
|
103
|
+
overflow-x: auto;
|
92
104
|
}
|
93
105
|
|
94
106
|
.page-section.active {
|
@@ -111,7 +123,7 @@ table {
|
|
111
123
|
border-collapse: collapse;
|
112
124
|
margin-top: 1em;
|
113
125
|
background-color: white;
|
114
|
-
box-shadow: 0 2px 4px rgba(0,
|
126
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
115
127
|
overflow-x: auto;
|
116
128
|
}
|
117
129
|
|
@@ -120,8 +132,7 @@ thead {
|
|
120
132
|
color: white;
|
121
133
|
}
|
122
134
|
|
123
|
-
th,
|
124
|
-
td {
|
135
|
+
th, td {
|
125
136
|
padding: 10px;
|
126
137
|
border: 1px solid #ddd;
|
127
138
|
text-align: left;
|
@@ -135,12 +146,14 @@ tbody tr:hover {
|
|
135
146
|
background-color: #e8f0fe;
|
136
147
|
}
|
137
148
|
|
149
|
+
/* Images */
|
138
150
|
.dash-image {
|
139
151
|
max-width: 100%;
|
140
152
|
height: auto;
|
141
153
|
margin: 1em 0;
|
142
154
|
}
|
143
155
|
|
156
|
+
/* Download Button */
|
144
157
|
.download-button {
|
145
158
|
display: inline-block;
|
146
159
|
padding: 0.5em 1em;
|
@@ -156,7 +169,7 @@ tbody tr:hover {
|
|
156
169
|
background-color: #547a9f;
|
157
170
|
}
|
158
171
|
|
159
|
-
/* Sortable
|
172
|
+
/* Sortable Table Headers */
|
160
173
|
table.sortable th {
|
161
174
|
cursor: pointer;
|
162
175
|
position: relative;
|
@@ -173,20 +186,21 @@ table.sortable th::after {
|
|
173
186
|
}
|
174
187
|
|
175
188
|
table.sortable th.sorted-asc::after {
|
176
|
-
content: "
|
189
|
+
content: "▲";
|
177
190
|
}
|
178
191
|
|
179
192
|
table.sortable th.sorted-desc::after {
|
180
|
-
content: "
|
193
|
+
content: "▼";
|
181
194
|
}
|
182
195
|
|
183
196
|
/* MiniPage Layout */
|
184
197
|
.minipage-row {
|
185
198
|
display: flex;
|
186
|
-
width: 100%;
|
187
199
|
gap: 20px;
|
188
200
|
margin-bottom: 20px;
|
201
|
+
max-width: 100%;
|
189
202
|
box-sizing: border-box;
|
203
|
+
overflow-x: auto;
|
190
204
|
}
|
191
205
|
|
192
206
|
.minipage-cell {
|
@@ -208,8 +222,7 @@ table.sortable th.sorted-desc::after {
|
|
208
222
|
}
|
209
223
|
|
210
224
|
.minipage-cell .syntax-block {
|
211
|
-
margin
|
212
|
-
margin-bottom: 0.5em;
|
225
|
+
margin: .5em 0;
|
213
226
|
}
|
214
227
|
|
215
228
|
.minipage-cell table {
|
@@ -233,8 +246,8 @@ table.sortable th.sorted-desc::after {
|
|
233
246
|
padding: 1em;
|
234
247
|
background: none;
|
235
248
|
color: inherit;
|
236
|
-
font-family: 'Fira Mono',
|
237
|
-
font-size:
|
249
|
+
font-family: 'Fira Mono','Consolas',monospace;
|
250
|
+
font-size: .95em;
|
238
251
|
}
|
239
252
|
|
240
253
|
.code-toolbar {
|
@@ -244,25 +257,24 @@ table.sortable th.sorted-desc::after {
|
|
244
257
|
z-index: 2;
|
245
258
|
}
|
246
259
|
|
247
|
-
.copy-btn,
|
248
|
-
.view-raw-btn {
|
260
|
+
.copy-btn, .view-raw-btn {
|
249
261
|
color: #fff;
|
250
262
|
background: #444;
|
251
263
|
border-radius: 4px;
|
252
264
|
padding: 2px 8px;
|
253
|
-
font-size:
|
265
|
+
font-size: .85em;
|
254
266
|
text-decoration: none;
|
255
267
|
margin-left: 4px;
|
256
268
|
cursor: pointer;
|
257
269
|
transition: background 0.2s;
|
258
270
|
}
|
259
271
|
|
260
|
-
.copy-btn:hover,
|
261
|
-
.view-raw-btn:hover {
|
272
|
+
.copy-btn:hover, .view-raw-btn:hover {
|
262
273
|
background: #1abc9c;
|
263
274
|
}
|
264
275
|
|
276
|
+
/* Table Wrapper */
|
265
277
|
.table-wrapper {
|
266
278
|
overflow-x: auto;
|
267
279
|
width: 100%;
|
268
|
-
}
|
280
|
+
}
|
staticdash/dashboard.py
CHANGED
@@ -2,7 +2,6 @@ import os
|
|
2
2
|
import shutil
|
3
3
|
import uuid
|
4
4
|
import pandas as pd
|
5
|
-
import plotly.graph_objects as go
|
6
5
|
from dominate import document
|
7
6
|
from dominate.tags import div, h1, h2, h3, h4, p, a, script, link
|
8
7
|
from dominate.util import raw as raw_util
|
@@ -161,7 +160,6 @@ class Dashboard:
|
|
161
160
|
os.makedirs(downloads_dir, exist_ok=True)
|
162
161
|
shutil.copytree(assets_src, assets_dst, dirs_exist_ok=True)
|
163
162
|
|
164
|
-
# Per-page HTML
|
165
163
|
for page in self.pages:
|
166
164
|
doc = document(title=page.title)
|
167
165
|
with doc.head:
|
@@ -173,13 +171,23 @@ class Dashboard:
|
|
173
171
|
doc.head.add(script(src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-python.min.js"))
|
174
172
|
doc.head.add(script(src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-javascript.min.js"))
|
175
173
|
with doc:
|
176
|
-
with div(
|
177
|
-
|
178
|
-
|
174
|
+
with div(id="sidebar"):
|
175
|
+
h1(self.title)
|
176
|
+
with div(cls="nav-links"):
|
177
|
+
for p in self.pages:
|
178
|
+
a(p.title, cls="nav-link", href="#", **{"data-target": f"page-{p.slug}"})
|
179
|
+
with div(id="sidebar-footer"):
|
180
|
+
a("Produced by staticdash", href="https://pypi.org/project/staticdash/", target="_blank")
|
181
|
+
with div(id="wrapper"):
|
182
|
+
with div(id="wrapper-inner"):
|
183
|
+
with div(id="content"):
|
184
|
+
for idx, p in enumerate(self.pages):
|
185
|
+
with div(id=f"page-{p.slug}", cls="page-section", style="display:none;") as section:
|
186
|
+
for el in p.render(idx, downloads_dir=downloads_dir, relative_prefix=""):
|
187
|
+
section += el
|
179
188
|
with open(os.path.join(pages_dir, f"{page.slug}.html"), "w") as f:
|
180
189
|
f.write(str(doc))
|
181
190
|
|
182
|
-
# Main index.html
|
183
191
|
index_doc = document(title=self.title)
|
184
192
|
with index_doc.head:
|
185
193
|
index_doc.head.add(link(rel="stylesheet", href="assets/css/style.css"))
|
@@ -193,16 +201,19 @@ class Dashboard:
|
|
193
201
|
with index_doc:
|
194
202
|
with div(id="sidebar"):
|
195
203
|
h1(self.title)
|
196
|
-
|
197
|
-
|
204
|
+
with div(cls="nav-links"):
|
205
|
+
for page in self.pages:
|
206
|
+
a(page.title, cls="nav-link", href="#", **{"data-target": f"page-{page.slug}"})
|
198
207
|
with div(id="sidebar-footer"):
|
199
208
|
a("Produced by staticdash", href="https://pypi.org/project/staticdash/", target="_blank")
|
200
209
|
|
201
|
-
with div(id="
|
202
|
-
|
203
|
-
with div(id=
|
204
|
-
for
|
205
|
-
section
|
210
|
+
with div(id="wrapper"):
|
211
|
+
with div(id="wrapper-inner"):
|
212
|
+
with div(id="content"):
|
213
|
+
for idx, page in enumerate(self.pages):
|
214
|
+
with div(id=f"page-{page.slug}", cls="page-section", style="display:none;") as section:
|
215
|
+
for el in page.render(idx, downloads_dir=downloads_dir, relative_prefix=""):
|
216
|
+
section += el
|
206
217
|
|
207
218
|
with open(os.path.join(output_dir, "index.html"), "w") as f:
|
208
|
-
f.write(str(index_doc))
|
219
|
+
f.write(str(index_doc))
|
@@ -0,0 +1,8 @@
|
|
1
|
+
staticdash/__init__.py,sha256=KqViaDkiQnhBI8-j3hr14umLDmPgddvdB_G1nJeC5Xs,38
|
2
|
+
staticdash/dashboard.py,sha256=5CWNHWFRgE0-DRQCnsxtmTigMN_Q2MuTGVGj03eUMXk,10572
|
3
|
+
staticdash/assets/css/style.css,sha256=wdTyRpTTYZtNOdb3NygdKYN6UEAKDwOoRx3-zyfphPQ,4232
|
4
|
+
staticdash/assets/js/script.js,sha256=pXqvTyw1LRNYl5u1kQbRtQkwe0dnd1yDs1Jstj7S-GU,4148
|
5
|
+
staticdash-0.4.1.dist-info/METADATA,sha256=Kw6f3V-VAbEFOlrx7Ea0IdCFA6V2fwv9MZgpIXF5uHU,1776
|
6
|
+
staticdash-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
staticdash-0.4.1.dist-info/top_level.txt,sha256=3MzZU6SptkUkjcHV1cvPji0H4aRzPphLHnpStgGEcxM,11
|
8
|
+
staticdash-0.4.1.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
staticdash/__init__.py,sha256=KqViaDkiQnhBI8-j3hr14umLDmPgddvdB_G1nJeC5Xs,38
|
2
|
-
staticdash/dashboard.py,sha256=lJMRt-3kGucPqGak6bty2y4xcTS4xhRYISoj9YGNVWY,9781
|
3
|
-
staticdash/assets/css/style.css,sha256=evXBWc22nS_hZGaPpION4c8EfSRcGx6oBl3L07Ftv_Y,4013
|
4
|
-
staticdash/assets/js/script.js,sha256=pXqvTyw1LRNYl5u1kQbRtQkwe0dnd1yDs1Jstj7S-GU,4148
|
5
|
-
staticdash-0.3.4.dist-info/METADATA,sha256=IpspSUq-FIx2n0FJn-B0MoNZdyD-YUFK22LaV2V1PfA,1776
|
6
|
-
staticdash-0.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
-
staticdash-0.3.4.dist-info/top_level.txt,sha256=3MzZU6SptkUkjcHV1cvPji0H4aRzPphLHnpStgGEcxM,11
|
8
|
-
staticdash-0.3.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|