staticdash 2025.34__py3-none-any.whl → 2026.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.
@@ -3,7 +3,8 @@ body {
3
3
  flex-direction: row;
4
4
  min-height: 100vh;
5
5
  margin: 0;
6
- font-family: sans-serif;
6
+ /* Use a robust system font stack to improve glyph coverage (e.g., minus sign) */
7
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
7
8
  background-color: #f9f9f9;
8
9
  color: #333;
9
10
  }
staticdash/dashboard.py CHANGED
@@ -10,6 +10,7 @@ from dominate.util import raw as raw_util
10
10
  import html
11
11
  import io
12
12
  import base64
13
+ from matplotlib import rc_context
13
14
 
14
15
  class AbstractPage:
15
16
  def __init__(self):
@@ -119,11 +120,32 @@ class Page(AbstractPage):
119
120
  fig = content
120
121
  if hasattr(fig, "to_html"):
121
122
  # Use local Plotly loaded in <head>
122
- elem = div(raw_util(fig.to_html(full_html=False, include_plotlyjs=False, config={'responsive': True})))
123
+ # Ensure the figure uses a robust font family so minus signs and other
124
+ # glyphs render correctly in the browser (some system fonts lack U+2212)
125
+ try:
126
+ font_family = None
127
+ if getattr(fig, 'layout', None) and getattr(fig.layout, 'font', None):
128
+ font_family = getattr(fig.layout.font, 'family', None)
129
+ if not font_family:
130
+ fig.update_layout(font_family='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif')
131
+ except Exception:
132
+ # Be defensive: don't fail rendering if layout manipulation isn't available
133
+ pass
134
+ # Render Plotly HTML and replace Unicode minus (U+2212) with ASCII hyphen-minus
135
+ # to avoid rendering issues when a user's font lacks the U+2212 glyph.
136
+ try:
137
+ plotly_html = fig.to_html(full_html=False, include_plotlyjs=False, config={'responsive': True})
138
+ if '\u2212' in plotly_html or '−' in plotly_html:
139
+ plotly_html = plotly_html.replace('−', '-')
140
+ elem = div(raw_util(plotly_html))
141
+ except Exception as e:
142
+ elem = div(f"Plotly figure could not be rendered: {e}")
123
143
  else:
124
144
  try:
125
145
  buf = io.BytesIO()
126
- fig.savefig(buf, format="png", bbox_inches="tight")
146
+ # Ensure we use ASCII hyphen-minus for negative ticks when saving
147
+ with rc_context({"axes.unicode_minus": False}):
148
+ fig.savefig(buf, format="png", bbox_inches="tight")
127
149
  buf.seek(0)
128
150
  img_base64 = base64.b64encode(buf.read()).decode("utf-8")
129
151
  buf.close()
@@ -202,11 +224,29 @@ class MiniPage(AbstractPage):
202
224
  fig = content
203
225
  if hasattr(fig, "to_html"):
204
226
  # Use local Plotly loaded in <head>
205
- elem = div(raw_util(fig.to_html(full_html=False, include_plotlyjs=False, config={'responsive': True})))
227
+ # Ensure the figure uses a robust font family so minus signs and other
228
+ # glyphs render correctly in the browser (some system fonts lack U+2212)
229
+ try:
230
+ font_family = None
231
+ if getattr(fig, 'layout', None) and getattr(fig.layout, 'font', None):
232
+ font_family = getattr(fig.layout.font, 'family', None)
233
+ if not font_family:
234
+ fig.update_layout(font_family='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif')
235
+ except Exception:
236
+ pass
237
+ try:
238
+ plotly_html = fig.to_html(full_html=False, include_plotlyjs=False, config={'responsive': True})
239
+ if '\u2212' in plotly_html or '−' in plotly_html:
240
+ plotly_html = plotly_html.replace('−', '-')
241
+ elem = div(raw_util(plotly_html))
242
+ except Exception as e:
243
+ elem = div(f"Plotly figure could not be rendered: {e}")
206
244
  else:
207
245
  try:
208
246
  buf = io.BytesIO()
209
- fig.savefig(buf, format="png", bbox_inches="tight")
247
+ # Ensure we use ASCII hyphen-minus for negative ticks when saving
248
+ with rc_context({"axes.unicode_minus": False}):
249
+ fig.savefig(buf, format="png", bbox_inches="tight")
210
250
  buf.seek(0)
211
251
  img_base64 = base64.b64encode(buf.read()).decode("utf-8")
212
252
  buf.close()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: staticdash
3
- Version: 2025.34
3
+ Version: 2026.1
4
4
  Summary: A lightweight static HTML dashboard generator with Plotly and pandas support.
5
5
  Author-email: Brian Day <brian.day1@gmail.com>
6
6
  License: CC0-1.0
@@ -57,6 +57,13 @@ pip install staticdash
57
57
 
58
58
  [View the latest demo dashboard](https://staticdash.github.io/staticdash/)
59
59
 
60
+ ## Examples
61
+
62
+ This repository includes two example dashboards that demonstrate staticdash capabilities:
63
+
64
+ - **Tutorial Dashboard:** [View tutorial_output/index.html](https://staticdash.github.io/staticdash/tutorial_output/index.html) - A comprehensive tutorial showing all staticdash features
65
+ - **Directory Example:** [View directory_out/index.html](https://staticdash.github.io/staticdash/directory_out/index.html) - Demonstrates the Directory class for aggregating multiple dashboards
66
+
60
67
  ---
61
68
 
62
69
  For a full example, see [`demo.py`](./demo.py) in this repository.
@@ -1,6 +1,6 @@
1
1
  staticdash/__init__.py,sha256=MQGR6LAqx2aFEA64MZz1ADxwpXLPn3VYNVIyjt9qx4Q,268
2
- staticdash/dashboard.py,sha256=Xuk3M8I5foTzIttJGdVyFG_z6SixoI9gTUBA3b_aCS4,26634
3
- staticdash/assets/css/style.css,sha256=JCoEkEzDiGc29jjhtWBMv-cirwzSWgOpCviMVIm6x2s,6533
2
+ staticdash/dashboard.py,sha256=9FqhqQmVu_siq_UxAPzyCZ6BLp1MtDKOU3JOjw83C8A,29381
3
+ staticdash/assets/css/style.css,sha256=eZX2-pNVUesRWR9ssR63cfmMjJEQkeZqQTU_f93FJGE,6697
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
6
6
  staticdash/assets/vendor/plotly/plotly.min.js,sha256=ChdxmnJ1FwSGEhXaDlxc2z-ajVDv9cuEy2-LgHhmgrA,3632287
@@ -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-2025.34.dist-info/METADATA,sha256=mJOkFjEZD9CSwHdJZOvCzF7pv2O1rPIcwtDBXRWmh_I,1960
17
- staticdash-2025.34.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- staticdash-2025.34.dist-info/top_level.txt,sha256=3MzZU6SptkUkjcHV1cvPji0H4aRzPphLHnpStgGEcxM,11
19
- staticdash-2025.34.dist-info/RECORD,,
16
+ staticdash-2026.1.dist-info/METADATA,sha256=wJ5uhhemiHd8BoxyktkpBxZQOBiqv2km8-eSHUKOTsk,2445
17
+ staticdash-2026.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
+ staticdash-2026.1.dist-info/top_level.txt,sha256=3MzZU6SptkUkjcHV1cvPji0H4aRzPphLHnpStgGEcxM,11
19
+ staticdash-2026.1.dist-info/RECORD,,