maidr 0.13.0__py3-none-any.whl → 0.14.0__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.
- maidr/__init__.py +1 -1
- maidr/core/maidr.py +3 -2
- maidr/core/plot/barplot.py +1 -1
- maidr/core/plot/lineplot.py +4 -0
- {maidr-0.13.0.dist-info → maidr-0.14.0.dist-info}/METADATA +1 -1
- {maidr-0.13.0.dist-info → maidr-0.14.0.dist-info}/RECORD +8 -8
- {maidr-0.13.0.dist-info → maidr-0.14.0.dist-info}/LICENSE +0 -0
- {maidr-0.13.0.dist-info → maidr-0.14.0.dist-info}/WHEEL +0 -0
maidr/__init__.py
CHANGED
maidr/core/maidr.py
CHANGED
|
@@ -44,6 +44,7 @@ class Maidr:
|
|
|
44
44
|
self._fig = fig
|
|
45
45
|
self._plots = []
|
|
46
46
|
self.maidr_id = None
|
|
47
|
+
self.selector_id = Maidr._unique_id()
|
|
47
48
|
|
|
48
49
|
@property
|
|
49
50
|
def fig(self) -> Figure:
|
|
@@ -125,7 +126,7 @@ class Maidr:
|
|
|
125
126
|
maidr = f"\nlet maidr = {json.dumps(self._flatten_maidr(), indent=2)}\n"
|
|
126
127
|
|
|
127
128
|
# In SVG we will replace maidr=id with the unique id.
|
|
128
|
-
svg = svg.replace('maidr="true"', f'maidr="{self.
|
|
129
|
+
svg = svg.replace('maidr="true"', f'maidr="{self.selector_id}"')
|
|
129
130
|
|
|
130
131
|
# Inject plot's svg and MAIDR structure into html tag.
|
|
131
132
|
return Maidr._inject_plot(svg, maidr, self.maidr_id)
|
|
@@ -142,7 +143,7 @@ class Maidr:
|
|
|
142
143
|
for plot in maidr:
|
|
143
144
|
if MaidrKey.SELECTOR in plot:
|
|
144
145
|
plot[MaidrKey.SELECTOR] = plot[MaidrKey.SELECTOR].replace(
|
|
145
|
-
"maidr='true'", f"maidr='{self.
|
|
146
|
+
"maidr='true'", f"maidr='{self.selector_id}'"
|
|
146
147
|
)
|
|
147
148
|
|
|
148
149
|
return maidr if len(maidr) != 1 else maidr[0]
|
maidr/core/plot/barplot.py
CHANGED
|
@@ -41,7 +41,7 @@ class BarPlot(MaidrPlot, ContainerExtractorMixin, LevelExtractorMixin, DictMerge
|
|
|
41
41
|
combined_data = (
|
|
42
42
|
zip(levels, data) if plot[0].orientation == "vertical" else zip(levels, data) # type: ignore
|
|
43
43
|
)
|
|
44
|
-
if len(data)
|
|
44
|
+
if len(data) == len(plot): # type: ignore
|
|
45
45
|
for x, y in combined_data: # type: ignore
|
|
46
46
|
formatted_data.append({"x": x, "y": y})
|
|
47
47
|
return formatted_data
|
maidr/core/plot/lineplot.py
CHANGED
|
@@ -6,6 +6,7 @@ from matplotlib.lines import Line2D
|
|
|
6
6
|
from maidr.core.enum import MaidrKey, PlotType
|
|
7
7
|
from maidr.core.plot import MaidrPlot
|
|
8
8
|
from maidr.exception import ExtractionError
|
|
9
|
+
from maidr.util.environment import Environment
|
|
9
10
|
from maidr.util.mixin import LineExtractorMixin
|
|
10
11
|
|
|
11
12
|
|
|
@@ -19,6 +20,9 @@ class LinePlot(MaidrPlot, LineExtractorMixin):
|
|
|
19
20
|
def _extract_plot_data(self) -> list[dict]:
|
|
20
21
|
plot = self.extract_line(self.ax)
|
|
21
22
|
data = self._extract_line_data(plot)
|
|
23
|
+
engine = Environment.get_engine()
|
|
24
|
+
if engine == "ts":
|
|
25
|
+
data = [data]
|
|
22
26
|
|
|
23
27
|
if data is None:
|
|
24
28
|
raise ExtractionError(self.type, plot)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: maidr
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
maidr/__init__.py,sha256=
|
|
1
|
+
maidr/__init__.py,sha256=YHLH1St1nSRY7D2GUwqgZPSgGdYODkUylSw3xzDwsqQ,369
|
|
2
2
|
maidr/api.py,sha256=u2WOQ8RWmXpzseEgbZJCB7FFZs7cEy-ya-Q18tGAYB4,1350
|
|
3
3
|
maidr/core/__init__.py,sha256=WgxLpSEYMc4k3OyEOf1shOxfEq0ASzppEIZYmE91ThQ,25
|
|
4
4
|
maidr/core/context_manager.py,sha256=HSzD4wpiALdI4Vm0QTdWqi1MWR5Uqy8BX_lOlCM3JYY,3463
|
|
@@ -7,14 +7,14 @@ maidr/core/enum/library.py,sha256=e8ujT_L-McJWfoVJd1ty9K_2bwITnf1j0GPLsnAcHes,10
|
|
|
7
7
|
maidr/core/enum/maidr_key.py,sha256=LNtt74d2gurefDNPD3SLLsTxKqO9qTyo3PBAUAyofnc,736
|
|
8
8
|
maidr/core/enum/plot_type.py,sha256=pyfyIwlq3taqe2Z1sVUSbMsTp5QTvYBlZXsMMMclEVM,293
|
|
9
9
|
maidr/core/figure_manager.py,sha256=HyYLIX3QzE-PmatSsTez9MmncTEu0wzPdFktZzE3NQM,3891
|
|
10
|
-
maidr/core/maidr.py,sha256=
|
|
10
|
+
maidr/core/maidr.py,sha256=9x1-CTvp7RGnEZTUdWleruxSM6Rsou3pQr_VI9IijnI,11511
|
|
11
11
|
maidr/core/plot/__init__.py,sha256=xDIpRGM-4DfaSSL3nKcXrjdMecCHJ6en4K4nA_fPefQ,83
|
|
12
|
-
maidr/core/plot/barplot.py,sha256=
|
|
12
|
+
maidr/core/plot/barplot.py,sha256=DGiMbakzER-Czpzekw-yBHXZuzWpBg7ODtJPQ8voI04,2605
|
|
13
13
|
maidr/core/plot/boxplot.py,sha256=roADG8xJYRQlZPYbfGBQSQRw8974lhVnngGKEKXJttk,6090
|
|
14
14
|
maidr/core/plot/grouped_barplot.py,sha256=pRmSAr6obcdjK4PPOt7-U77tMMKLM4lkKOiOklS8TbA,2061
|
|
15
15
|
maidr/core/plot/heatmap.py,sha256=_Hn_wXsu-BQBYs4YO440-WRhmXAJ1WeBndBGVEUAP5M,2447
|
|
16
16
|
maidr/core/plot/histogram.py,sha256=QV5W-6ZJQQcZsrM91JJBX-ONktJzH7yg_et5_bBPfQQ,1525
|
|
17
|
-
maidr/core/plot/lineplot.py,sha256=
|
|
17
|
+
maidr/core/plot/lineplot.py,sha256=TAqajxACVjs8ydIf_AiqUzwnfPdFydHhxc_TGDFsxcc,1282
|
|
18
18
|
maidr/core/plot/maidr_plot.py,sha256=_9Ugn3cUwi-URxeTRbDAKDZwASrB65p9TKOXhFX1zbU,3176
|
|
19
19
|
maidr/core/plot/maidr_plot_factory.py,sha256=Ai-vFpn9YhZPQeVQxdjq0prVJNcGZ8NJvS3eKAxxZ_w,1681
|
|
20
20
|
maidr/core/plot/scatterplot.py,sha256=sQhT80w0Sp9AsUAZi4v6lfWsHJAvuFcer2aAE2NpAYE,1240
|
|
@@ -37,7 +37,7 @@ maidr/util/mixin/extractor_mixin.py,sha256=Y-34424UR8ECHECAuQZ7zKhyk5QC6GOiUeCMR
|
|
|
37
37
|
maidr/util/mixin/merger_mixin.py,sha256=V0qLw_6DUB7X6CQ3BCMpsCQX_ZuwAhoSTm_E4xAJFKM,712
|
|
38
38
|
maidr/widget/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
39
|
maidr/widget/shiny.py,sha256=wrrw2KAIpE_A6CNQGBtNHauR1DjenA_n47qlFXX9_rk,745
|
|
40
|
-
maidr-0.
|
|
41
|
-
maidr-0.
|
|
42
|
-
maidr-0.
|
|
43
|
-
maidr-0.
|
|
40
|
+
maidr-0.14.0.dist-info/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
|
41
|
+
maidr-0.14.0.dist-info/METADATA,sha256=2wr_G1PtwvMel2JVhADxYONzNHFPpEBbtyDe7zNIwNc,2688
|
|
42
|
+
maidr-0.14.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
43
|
+
maidr-0.14.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|