staticdash 2026.5__py3-none-any.whl → 2026.6__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/dashboard.py +73 -24
- {staticdash-2026.5.dist-info → staticdash-2026.6.dist-info}/METADATA +1 -1
- {staticdash-2026.5.dist-info → staticdash-2026.6.dist-info}/RECORD +5 -5
- {staticdash-2026.5.dist-info → staticdash-2026.6.dist-info}/WHEEL +0 -0
- {staticdash-2026.5.dist-info → staticdash-2026.6.dist-info}/top_level.txt +0 -0
staticdash/dashboard.py
CHANGED
|
@@ -12,6 +12,7 @@ import io
|
|
|
12
12
|
import base64
|
|
13
13
|
import matplotlib
|
|
14
14
|
from matplotlib import rc_context
|
|
15
|
+
import json
|
|
15
16
|
|
|
16
17
|
def split_paragraphs_preserving_math(text):
|
|
17
18
|
"""
|
|
@@ -210,21 +211,43 @@ class Page(AbstractPage):
|
|
|
210
211
|
except Exception:
|
|
211
212
|
pass
|
|
212
213
|
|
|
213
|
-
#
|
|
214
|
-
#
|
|
215
|
-
#
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
214
|
+
# Defer Plotly.newPlot until the Plotly bundle is available
|
|
215
|
+
# by embedding the figure JSON and calling newPlot from a
|
|
216
|
+
# small loader that polls for `window.Plotly`.
|
|
217
|
+
try:
|
|
218
|
+
fig_json = fig.to_json()
|
|
219
|
+
except Exception:
|
|
220
|
+
# Fallback: use the html fragment (older path)
|
|
221
|
+
plotly_html = fig.to_html(full_html=False, include_plotlyjs=False, config={'responsive': True})
|
|
222
|
+
container_style = "width:100%;"
|
|
223
|
+
if specified_width is not None:
|
|
224
|
+
container_style = f"width:{specified_width}px;"
|
|
225
|
+
if specified_height is not None:
|
|
226
|
+
container_style = container_style + f" height:{specified_height}px;"
|
|
227
|
+
plot_wrapped = f'<div style="{container_style}">{plotly_html}</div>'
|
|
228
|
+
else:
|
|
229
|
+
fig_json = fig_json.replace('</script>', '<\\/script>')
|
|
230
|
+
div_id = f'plot-{uuid.uuid4()}'
|
|
231
|
+
container_style = "width:100%;"
|
|
232
|
+
if specified_width is not None:
|
|
233
|
+
container_style = f"width:{specified_width}px;"
|
|
234
|
+
if specified_height is not None:
|
|
235
|
+
container_style = container_style + f" height:{specified_height}px;"
|
|
236
|
+
|
|
237
|
+
plot_div = f'<div id="{div_id}" class="plotly-graph-div" style="{container_style}"></div>'
|
|
238
|
+
loader = (
|
|
239
|
+
'<script type="text/javascript">(function(){' \
|
|
240
|
+
f'var fig = {fig_json};' \
|
|
241
|
+
'function tryPlot(){' \
|
|
242
|
+
'if(window.Plotly && typeof window.Plotly.newPlot === "function"){' \
|
|
243
|
+
f'Plotly.newPlot("{div_id}", fig.data, fig.layout, {json.dumps({"responsive": True})});' \
|
|
244
|
+
'} else { setTimeout(tryPlot, 50); }' \
|
|
245
|
+
'}' \
|
|
246
|
+
'if(document.readyState === "complete"){ tryPlot(); } else { window.addEventListener("load", tryPlot); }' \
|
|
247
|
+
'})();</script>'
|
|
248
|
+
)
|
|
249
|
+
plot_wrapped = plot_div + loader
|
|
226
250
|
|
|
227
|
-
plot_wrapped = f'<div style="{container_style}">{plotly_html}</div>'
|
|
228
251
|
# Apply alignment wrapper
|
|
229
252
|
if specified_align not in ("left", "right", "center"):
|
|
230
253
|
specified_align = "center"
|
|
@@ -427,16 +450,42 @@ class MiniPage(AbstractPage):
|
|
|
427
450
|
except Exception:
|
|
428
451
|
pass
|
|
429
452
|
|
|
430
|
-
#
|
|
431
|
-
# embedding
|
|
432
|
-
#
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
container_style =
|
|
439
|
-
|
|
453
|
+
# Defer Plotly.newPlot until the Plotly bundle is available
|
|
454
|
+
# by embedding the figure JSON and calling newPlot from a
|
|
455
|
+
# small loader that polls for `window.Plotly`.
|
|
456
|
+
try:
|
|
457
|
+
fig_json = fig.to_json()
|
|
458
|
+
except Exception:
|
|
459
|
+
# Fallback: use the html fragment (older path)
|
|
460
|
+
plotly_html = fig.to_html(full_html=False, include_plotlyjs=False, config={'responsive': True})
|
|
461
|
+
container_style = "width:100%;"
|
|
462
|
+
if specified_width is not None:
|
|
463
|
+
container_style = f"width:{specified_width}px;"
|
|
464
|
+
if specified_height is not None:
|
|
465
|
+
container_style = container_style + f" height:{specified_height}px;"
|
|
466
|
+
plot_wrapped = f'<div style="{container_style}">{plotly_html}</div>'
|
|
467
|
+
else:
|
|
468
|
+
fig_json = fig_json.replace('</script>', '<\\/script>')
|
|
469
|
+
div_id = f'plot-{uuid.uuid4()}'
|
|
470
|
+
container_style = "width:100%;"
|
|
471
|
+
if specified_width is not None:
|
|
472
|
+
container_style = f"width:{specified_width}px;"
|
|
473
|
+
if specified_height is not None:
|
|
474
|
+
container_style = container_style + f" height:{specified_height}px;"
|
|
475
|
+
|
|
476
|
+
plot_div = f'<div id="{div_id}" class="plotly-graph-div" style="{container_style}"></div>'
|
|
477
|
+
loader = (
|
|
478
|
+
'<script type="text/javascript">(function(){' \
|
|
479
|
+
f'var fig = {fig_json};' \
|
|
480
|
+
'function tryPlot(){' \
|
|
481
|
+
'if(window.Plotly && typeof window.Plotly.newPlot === "function"){' \
|
|
482
|
+
f'Plotly.newPlot("{div_id}", fig.data, fig.layout, {json.dumps({"responsive": True})});' \
|
|
483
|
+
'} else { setTimeout(tryPlot, 50); }' \
|
|
484
|
+
'}' \
|
|
485
|
+
'if(document.readyState === "complete"){ tryPlot(); } else { window.addEventListener("load", tryPlot); }' \
|
|
486
|
+
'})();</script>'
|
|
487
|
+
)
|
|
488
|
+
plot_wrapped = plot_div + loader
|
|
440
489
|
if specified_align not in ("left", "right", "center"):
|
|
441
490
|
specified_align = "center"
|
|
442
491
|
if specified_align == "center":
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
staticdash/__init__.py,sha256=MQGR6LAqx2aFEA64MZz1ADxwpXLPn3VYNVIyjt9qx4Q,268
|
|
2
|
-
staticdash/dashboard.py,sha256=
|
|
2
|
+
staticdash/dashboard.py,sha256=7XCwSKzmY9K-DwSikzykQGtbsxzxEfqAaTJlUP-KuGE,46106
|
|
3
3
|
staticdash/assets/css/style.css,sha256=AOYdkw-nK_WvV6im_Y34gz4rJZWifk5o-mRmCKwMP60,7014
|
|
4
4
|
staticdash/assets/js/script.js,sha256=7xBRlz_19wybbNVwAcfuKNXtDEojGB4EB0Yj4klsoTA,6998
|
|
5
5
|
staticdash/assets/vendor/mathjax/tex-mml-chtml.js,sha256=MASABpB4tYktI2Oitl4t-78w_lyA-D7b_s9GEP0JOGI,1173007
|
|
@@ -13,7 +13,7 @@ staticdash/assets/vendor/prism/components/prism-json.min.js,sha256=lW2GuqWufsQQZ
|
|
|
13
13
|
staticdash/assets/vendor/prism/components/prism-markup.min.js,sha256=h5_J0lbDUtmA4FOFf6cHMwhTuL-2fOKE6mYaJN7FdW4,2850
|
|
14
14
|
staticdash/assets/vendor/prism/components/prism-python.min.js,sha256=7UOFaFvPLUk1yNu6tL3hZgPaEyngktK_NsPa3WfpqFw,2113
|
|
15
15
|
staticdash/assets/vendor/prism/components/prism-sql.min.js,sha256=P8X4zmmVDsc63JcvBh30Kq6nj6pIZHCRNOoq3Ag_OjM,3261
|
|
16
|
-
staticdash-2026.
|
|
17
|
-
staticdash-2026.
|
|
18
|
-
staticdash-2026.
|
|
19
|
-
staticdash-2026.
|
|
16
|
+
staticdash-2026.6.dist-info/METADATA,sha256=gYrNTyhXOQWigyRspfiGBRzPJ7qfV17nooCMRFUdH-o,2521
|
|
17
|
+
staticdash-2026.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
18
|
+
staticdash-2026.6.dist-info/top_level.txt,sha256=3MzZU6SptkUkjcHV1cvPji0H4aRzPphLHnpStgGEcxM,11
|
|
19
|
+
staticdash-2026.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|