staticdash 2025.35__tar.gz → 2026.2__tar.gz

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.
Files changed (25) hide show
  1. {staticdash-2025.35 → staticdash-2026.2}/PKG-INFO +1 -1
  2. {staticdash-2025.35 → staticdash-2026.2}/pyproject.toml +1 -1
  3. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/css/style.css +12 -1
  4. {staticdash-2025.35 → staticdash-2026.2}/staticdash/dashboard.py +45 -4
  5. {staticdash-2025.35 → staticdash-2026.2}/staticdash.egg-info/PKG-INFO +1 -1
  6. {staticdash-2025.35 → staticdash-2026.2}/README.md +0 -0
  7. {staticdash-2025.35 → staticdash-2026.2}/setup.cfg +0 -0
  8. {staticdash-2025.35 → staticdash-2026.2}/setup.py +0 -0
  9. {staticdash-2025.35 → staticdash-2026.2}/staticdash/__init__.py +0 -0
  10. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/js/script.js +0 -0
  11. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/mathjax/tex-mml-chtml.js +0 -0
  12. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/plotly/plotly.min.js +0 -0
  13. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/prism/components/prism-bash.min.js +0 -0
  14. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/prism/components/prism-c.min.js +0 -0
  15. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/prism/components/prism-javascript.min.js +0 -0
  16. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/prism/components/prism-json.min.js +0 -0
  17. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/prism/components/prism-markup.min.js +0 -0
  18. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/prism/components/prism-python.min.js +0 -0
  19. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/prism/components/prism-sql.min.js +0 -0
  20. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/prism/prism-tomorrow.min.css +0 -0
  21. {staticdash-2025.35 → staticdash-2026.2}/staticdash/assets/vendor/prism/prism.min.js +0 -0
  22. {staticdash-2025.35 → staticdash-2026.2}/staticdash.egg-info/SOURCES.txt +0 -0
  23. {staticdash-2025.35 → staticdash-2026.2}/staticdash.egg-info/dependency_links.txt +0 -0
  24. {staticdash-2025.35 → staticdash-2026.2}/staticdash.egg-info/requires.txt +0 -0
  25. {staticdash-2025.35 → staticdash-2026.2}/staticdash.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: staticdash
3
- Version: 2025.35
3
+ Version: 2026.2
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "staticdash"
7
- version = "2025.35"
7
+ version = "2026.2"
8
8
  description = "A lightweight static HTML dashboard generator with Plotly and pandas support."
9
9
  authors = [
10
10
  { name = "Brian Day", email = "brian.day1@gmail.com" }
@@ -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
  }
@@ -152,6 +153,16 @@ body {
152
153
  width: 100%;
153
154
  }
154
155
 
156
+ /* Ensure Plotly SVG text inherits a robust font stack so glyphs (e.g., minus) render */
157
+ .plotly {
158
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
159
+ }
160
+ .plotly svg text,
161
+ .plotly .main-svg text {
162
+ font-family: inherit;
163
+ -webkit-font-smoothing: antialiased;
164
+ }
165
+
155
166
  .plot-container .plotly-graph-div {
156
167
  width: 100% !important;
157
168
  height: auto !important;
@@ -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,30 @@ 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
+ elem = div(raw_util(plotly_html))
139
+ except Exception as e:
140
+ elem = div(f"Plotly figure could not be rendered: {e}")
123
141
  else:
124
142
  try:
125
143
  buf = io.BytesIO()
126
- fig.savefig(buf, format="png", bbox_inches="tight")
144
+ # Ensure we use ASCII hyphen-minus for negative ticks when saving
145
+ with rc_context({"axes.unicode_minus": False}):
146
+ fig.savefig(buf, format="png", bbox_inches="tight")
127
147
  buf.seek(0)
128
148
  img_base64 = base64.b64encode(buf.read()).decode("utf-8")
129
149
  buf.close()
@@ -202,11 +222,27 @@ class MiniPage(AbstractPage):
202
222
  fig = content
203
223
  if hasattr(fig, "to_html"):
204
224
  # Use local Plotly loaded in <head>
205
- elem = div(raw_util(fig.to_html(full_html=False, include_plotlyjs=False, config={'responsive': True})))
225
+ # Ensure the figure uses a robust font family so minus signs and other
226
+ # glyphs render correctly in the browser (some system fonts lack U+2212)
227
+ try:
228
+ font_family = None
229
+ if getattr(fig, 'layout', None) and getattr(fig.layout, 'font', None):
230
+ font_family = getattr(fig.layout.font, 'family', None)
231
+ if not font_family:
232
+ fig.update_layout(font_family='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif')
233
+ except Exception:
234
+ pass
235
+ try:
236
+ plotly_html = fig.to_html(full_html=False, include_plotlyjs=False, config={'responsive': True})
237
+ elem = div(raw_util(plotly_html))
238
+ except Exception as e:
239
+ elem = div(f"Plotly figure could not be rendered: {e}")
206
240
  else:
207
241
  try:
208
242
  buf = io.BytesIO()
209
- fig.savefig(buf, format="png", bbox_inches="tight")
243
+ # Ensure we use ASCII hyphen-minus for negative ticks when saving
244
+ with rc_context({"axes.unicode_minus": False}):
245
+ fig.savefig(buf, format="png", bbox_inches="tight")
210
246
  buf.seek(0)
211
247
  img_base64 = base64.b64encode(buf.read()).decode("utf-8")
212
248
  buf.close()
@@ -311,6 +347,9 @@ class Dashboard:
311
347
  shutil.copytree(assets_src, assets_dst, dirs_exist_ok=True)
312
348
 
313
349
  def _add_head_assets(head, rel_prefix, effective_width):
350
+ # Ensure pages declare UTF-8 to avoid character misinterpretation
351
+ head.add(raw_util('<meta charset="utf-8" />'))
352
+ head.add(raw_util('<meta name="viewport" content="width=device-width, initial-scale=1" />'))
314
353
  # Your CSS/JS
315
354
  head.add(link(rel="stylesheet", href=f"{rel_prefix}assets/css/style.css"))
316
355
  head.add(script(type="text/javascript", src=f"{rel_prefix}assets/js/script.js"))
@@ -528,6 +567,8 @@ class Directory:
528
567
 
529
568
  # Add CSS and basic styling
530
569
  with doc.head:
570
+ # Ensure charset is declared for the landing page too
571
+ doc.head.add(raw_util('<meta charset="utf-8" />'))
531
572
  link(rel="stylesheet", href="assets/css/style.css")
532
573
  raw_util("""
533
574
  <style>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: staticdash
3
- Version: 2025.35
3
+ Version: 2026.2
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
File without changes
File without changes
File without changes