maidr 1.4.3__tar.gz → 1.4.4__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.
- {maidr-1.4.3 → maidr-1.4.4}/PKG-INFO +1 -1
- {maidr-1.4.3 → maidr-1.4.4}/maidr/__init__.py +1 -1
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/maidr.py +2 -66
- {maidr-1.4.3 → maidr-1.4.4}/pyproject.toml +1 -1
- {maidr-1.4.3 → maidr-1.4.4}/LICENSE +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/README.md +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/api.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/__init__.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/context_manager.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/enum/__init__.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/enum/library.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/enum/maidr_key.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/enum/plot_type.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/enum/smooth_keywords.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/figure_manager.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/__init__.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/barplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/boxplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/candlestick.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/grouped_barplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/heatmap.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/histogram.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/lineplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/maidr_plot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/maidr_plot_factory.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/mplfinance_barplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/mplfinance_lineplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/regplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/core/plot/scatterplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/exception/__init__.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/exception/extraction_error.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/__init__.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/barplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/boxplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/candlestick.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/clear.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/common.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/heatmap.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/highlight.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/histogram.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/kdeplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/lineplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/mplfinance.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/regplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/patch/scatterplot.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/__init__.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/dedup_utils.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/environment.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/mixin/__init__.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/mixin/extractor_mixin.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/mixin/merger_mixin.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/mplfinance_utils.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/plot_detection.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/regression_line_utils.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/util/svg_utils.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/widget/__init__.py +0 -0
- {maidr-1.4.3 → maidr-1.4.4}/maidr/widget/shiny.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: maidr
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.4
|
|
4
4
|
Summary: Multimodal Access and Interactive Data Representations
|
|
5
5
|
License: GPL-3.0-or-later
|
|
6
6
|
Keywords: accessibility,visualization,sonification,braille,tactile,multimodal,data representation,blind,low vision,visual impairments
|
|
@@ -25,11 +25,6 @@ from maidr.core.plot import MaidrPlot
|
|
|
25
25
|
from maidr.util.environment import Environment
|
|
26
26
|
from maidr.util.dedup_utils import deduplicate_smooth_and_line
|
|
27
27
|
|
|
28
|
-
# Module-level cache for version to avoid repeated API calls
|
|
29
|
-
_MAIDR_VERSION_CACHE: str | None = None
|
|
30
|
-
_MAIDR_VERSION_CACHE_TIME: float = 0.0
|
|
31
|
-
_MAIDR_CACHE_DURATION = 3600 # Cache for 1 hour
|
|
32
|
-
|
|
33
28
|
|
|
34
29
|
class Maidr:
|
|
35
30
|
"""
|
|
@@ -281,70 +276,11 @@ class Maidr:
|
|
|
281
276
|
"""Generate a unique identifier string using UUID4."""
|
|
282
277
|
return str(uuid.uuid4())
|
|
283
278
|
|
|
284
|
-
@staticmethod
|
|
285
|
-
def _get_latest_maidr_version() -> str:
|
|
286
|
-
"""
|
|
287
|
-
Query the npm registry API to get the latest version of maidr with caching.
|
|
288
|
-
|
|
289
|
-
Returns
|
|
290
|
-
-------
|
|
291
|
-
str
|
|
292
|
-
The latest version of maidr from npm registry, or 'latest' as fallback.
|
|
293
|
-
"""
|
|
294
|
-
import time
|
|
295
|
-
|
|
296
|
-
global _MAIDR_VERSION_CACHE, _MAIDR_VERSION_CACHE_TIME
|
|
297
|
-
|
|
298
|
-
# Check if version fetching is disabled via environment variable
|
|
299
|
-
if os.getenv("MAIDR_DISABLE_VERSION_FETCH", "").lower() in ("true", "1", "yes"):
|
|
300
|
-
return "latest"
|
|
301
|
-
|
|
302
|
-
current_time = time.time()
|
|
303
|
-
|
|
304
|
-
# Check if we have a valid cached version
|
|
305
|
-
if (
|
|
306
|
-
_MAIDR_VERSION_CACHE is not None
|
|
307
|
-
and current_time - _MAIDR_VERSION_CACHE_TIME < _MAIDR_CACHE_DURATION
|
|
308
|
-
):
|
|
309
|
-
return _MAIDR_VERSION_CACHE
|
|
310
|
-
|
|
311
|
-
try:
|
|
312
|
-
# Query npm registry API for maidr package
|
|
313
|
-
with urllib.request.urlopen(
|
|
314
|
-
"https://registry.npmjs.org/maidr/latest", timeout=5 # 5 second timeout
|
|
315
|
-
) as response:
|
|
316
|
-
if response.status == 200:
|
|
317
|
-
data = json.loads(response.read().decode("utf-8"))
|
|
318
|
-
version = data.get("version", "latest")
|
|
319
|
-
|
|
320
|
-
# Cache the successful result
|
|
321
|
-
_MAIDR_VERSION_CACHE = version
|
|
322
|
-
_MAIDR_VERSION_CACHE_TIME = current_time
|
|
323
|
-
|
|
324
|
-
return version
|
|
325
|
-
|
|
326
|
-
except Exception:
|
|
327
|
-
# Any error - just use latest
|
|
328
|
-
pass
|
|
329
|
-
|
|
330
|
-
# Fallback to 'latest' if API call fails
|
|
331
|
-
return "latest"
|
|
332
|
-
|
|
333
|
-
@staticmethod
|
|
334
|
-
def clear_version_cache() -> None:
|
|
335
|
-
"""Clear the cached version to force a fresh API call on next request."""
|
|
336
|
-
global _MAIDR_VERSION_CACHE, _MAIDR_VERSION_CACHE_TIME
|
|
337
|
-
_MAIDR_VERSION_CACHE = None
|
|
338
|
-
_MAIDR_VERSION_CACHE_TIME = 0.0
|
|
339
|
-
|
|
340
279
|
@staticmethod
|
|
341
280
|
def _inject_plot(plot: HTML, maidr: str, maidr_id, use_iframe: bool = True) -> Tag:
|
|
342
281
|
"""Embed the plot and associated MAIDR scripts into the HTML structure."""
|
|
343
282
|
# Get the latest version from npm registry
|
|
344
|
-
|
|
345
|
-
MAIDR_TS_CDN_URL = (
|
|
346
|
-
f"https://cdn.jsdelivr.net/npm/maidr@{latest_version}/dist/maidr.js"
|
|
347
|
-
)
|
|
283
|
+
MAIDR_TS_CDN_URL = f"https://cdn.jsdelivr.net/npm/maidr@latest/dist/maidr.js"
|
|
348
284
|
|
|
349
285
|
script = f"""
|
|
350
286
|
if (!document.querySelector('script[src="{MAIDR_TS_CDN_URL}"]'))
|
|
@@ -366,7 +302,7 @@ class Maidr:
|
|
|
366
302
|
base_html = tags.div(
|
|
367
303
|
tags.link(
|
|
368
304
|
rel="stylesheet",
|
|
369
|
-
href=f"https://cdn.jsdelivr.net/npm/maidr@
|
|
305
|
+
href=f"https://cdn.jsdelivr.net/npm/maidr@latest/dist/maidr_style.css",
|
|
370
306
|
),
|
|
371
307
|
tags.script(script, type="text/javascript"),
|
|
372
308
|
tags.div(plot),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|