maidr 0.19.1__tar.gz → 0.21.0__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 (43) hide show
  1. {maidr-0.19.1 → maidr-0.21.0}/PKG-INFO +1 -1
  2. {maidr-0.19.1 → maidr-0.21.0}/maidr/__init__.py +1 -1
  3. {maidr-0.19.1 → maidr-0.21.0}/maidr/api.py +1 -3
  4. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/context_manager.py +19 -15
  5. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/enum/maidr_key.py +4 -3
  6. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/figure_manager.py +1 -0
  7. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/maidr.py +24 -18
  8. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/barplot.py +0 -1
  9. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/boxplot.py +14 -20
  10. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/grouped_barplot.py +6 -9
  11. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/heatmap.py +9 -9
  12. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/lineplot.py +4 -2
  13. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/maidr_plot.py +1 -1
  14. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/scatterplot.py +8 -9
  15. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/highlight.py +10 -6
  16. {maidr-0.19.1 → maidr-0.21.0}/maidr/util/environment.py +1 -1
  17. {maidr-0.19.1 → maidr-0.21.0}/pyproject.toml +1 -1
  18. {maidr-0.19.1 → maidr-0.21.0}/LICENSE +0 -0
  19. {maidr-0.19.1 → maidr-0.21.0}/README.md +0 -0
  20. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/__init__.py +0 -0
  21. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/enum/__init__.py +0 -0
  22. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/enum/library.py +0 -0
  23. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/enum/plot_type.py +0 -0
  24. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/__init__.py +0 -0
  25. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/histogram.py +0 -0
  26. {maidr-0.19.1 → maidr-0.21.0}/maidr/core/plot/maidr_plot_factory.py +0 -0
  27. {maidr-0.19.1 → maidr-0.21.0}/maidr/exception/__init__.py +0 -0
  28. {maidr-0.19.1 → maidr-0.21.0}/maidr/exception/extraction_error.py +0 -0
  29. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/__init__.py +0 -0
  30. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/barplot.py +0 -0
  31. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/boxplot.py +0 -0
  32. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/clear.py +0 -0
  33. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/common.py +0 -0
  34. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/heatmap.py +0 -0
  35. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/histogram.py +0 -0
  36. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/lineplot.py +0 -0
  37. {maidr-0.19.1 → maidr-0.21.0}/maidr/patch/scatterplot.py +0 -0
  38. {maidr-0.19.1 → maidr-0.21.0}/maidr/util/__init__.py +0 -0
  39. {maidr-0.19.1 → maidr-0.21.0}/maidr/util/mixin/__init__.py +0 -0
  40. {maidr-0.19.1 → maidr-0.21.0}/maidr/util/mixin/extractor_mixin.py +0 -0
  41. {maidr-0.19.1 → maidr-0.21.0}/maidr/util/mixin/merger_mixin.py +0 -0
  42. {maidr-0.19.1 → maidr-0.21.0}/maidr/widget/__init__.py +0 -0
  43. {maidr-0.19.1 → maidr-0.21.0}/maidr/widget/shiny.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: maidr
3
- Version: 0.19.1
3
+ Version: 0.21.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
- __version__ = "0.19.1"
1
+ __version__ = "0.21.0"
2
2
 
3
3
  from .api import close, render, save_html, set_engine, show, stacked
4
4
  from .core import Maidr
@@ -20,12 +20,10 @@ def render(plot: Any) -> Tag:
20
20
 
21
21
  def show(plot: Any, renderer: Literal["auto", "ipython", "browser"] = "auto") -> object:
22
22
  ax = FigureManager.get_axes(plot)
23
- htmls = []
24
23
  if isinstance(ax, list):
25
24
  for axes in ax:
26
25
  maidr = FigureManager.get_maidr(axes.get_figure())
27
- htmls.append(maidr.render())
28
- return htmls[-1].show(renderer)
26
+ return maidr.show(renderer)
29
27
  else:
30
28
  maidr = FigureManager.get_maidr(ax.get_figure())
31
29
  return maidr.show(renderer)
@@ -77,8 +77,9 @@ class HighlightContextManager:
77
77
  _instance = None
78
78
  _lock = threading.Lock()
79
79
 
80
- _maidr_element = contextvars.ContextVar("_maidr_element", default=False)
81
- _elements = contextvars.ContextVar("elements", default=[])
80
+ elements = {}
81
+ elements_to_highlight = []
82
+ selector_ids = []
82
83
 
83
84
  def __new__(cls):
84
85
  if not cls._instance:
@@ -88,31 +89,34 @@ class HighlightContextManager:
88
89
  return cls._instance
89
90
 
90
91
  @classmethod
91
- def is_maidr_element(cls):
92
- return cls._maidr_element.get()
92
+ def is_maidr_element(cls, id):
93
+ return id in cls.elements
94
+
95
+ @classmethod
96
+ def get_selector_id(cls, id):
97
+ return cls.elements[id]
93
98
 
94
99
  @classmethod
95
100
  @contextlib.contextmanager
96
- def set_maidr_element(cls, element):
97
- if element not in cls._elements.get():
101
+ def set_maidr_element(cls, element, id):
102
+ if element not in cls.elements_to_highlight:
98
103
  yield
99
104
  return
100
105
 
101
- token_maidr_element = cls._maidr_element.set(True)
102
106
  try:
107
+ cls.elements[id] = cls.selector_ids[
108
+ cls.elements_to_highlight.index(element)
109
+ ]
103
110
  yield
104
111
  finally:
105
- cls._maidr_element.reset(token_maidr_element)
106
- # Remove element from the context list after tagging
107
- new_elements = cls._elements.get().copy()
108
- new_elements.remove(element)
109
- cls._elements.set(new_elements)
112
+ del cls.elements[id]
110
113
 
111
114
  @classmethod
112
115
  @contextlib.contextmanager
113
- def set_maidr_elements(cls, elements: list):
114
- token_paths = cls._elements.set(elements)
116
+ def set_maidr_elements(cls, elements: list, selector_ids: list):
117
+ cls.elements_to_highlight = elements
118
+ cls.selector_ids = selector_ids
115
119
  try:
116
120
  yield
117
121
  finally:
118
- cls._elements.reset(token_paths)
122
+ cls.elements_to_highlight.clear()
@@ -5,12 +5,13 @@ class MaidrKey(str, Enum):
5
5
  # Maidr info keys.
6
6
  ID = "id"
7
7
  ORIENTATION = "orientation"
8
- SELECTOR = "selector"
8
+ SELECTOR = "selectors"
9
9
  TYPE = "type"
10
10
 
11
11
  # Plot data keys.
12
12
  AXES = "axes"
13
13
  DATA = "data"
14
+ POINTS = "points"
14
15
  LEVEL = "level"
15
16
  X = "x"
16
17
  Y = "y"
@@ -22,13 +23,13 @@ class MaidrKey(str, Enum):
22
23
  TITLE = "title"
23
24
 
24
25
  # Box plot keys.
25
- LOWER_OUTLIER = "lower_outlier"
26
+ LOWER_OUTLIER = "lowerOutliers"
26
27
  MIN = "min"
27
28
  MAX = "max"
28
29
  Q1 = "q1"
29
30
  Q2 = "q2"
30
31
  Q3 = "q3"
31
- UPPER_OUTLIER = "upper_outlier"
32
+ UPPER_OUTLIER = "upperOutliers"
32
33
 
33
34
  # Grouped bar and heatmap plot keys.
34
35
  FILL = "fill"
@@ -61,6 +61,7 @@ class FigureManager:
61
61
  maidr = cls._get_maidr(ax.get_figure(), plot_type)
62
62
  plot = MaidrPlotFactory.create(ax, plot_type, **kwargs)
63
63
  maidr.plots.append(plot)
64
+ maidr.selector_ids.append(Maidr._unique_id())
64
65
  return maidr
65
66
 
66
67
  @classmethod
@@ -11,6 +11,7 @@ from typing import Any, Literal
11
11
  from htmltools import HTML, HTMLDocument, Tag, tags
12
12
  from lxml import etree
13
13
  from matplotlib.figure import Figure
14
+ from matplotlib.patches import Rectangle
14
15
 
15
16
  from maidr.core.context_manager import HighlightContextManager
16
17
  from maidr.core.enum.maidr_key import MaidrKey
@@ -45,7 +46,7 @@ class Maidr:
45
46
  self._fig = fig
46
47
  self._plots = []
47
48
  self.maidr_id = None
48
- self.selector_id = Maidr._unique_id()
49
+ self.selector_ids = []
49
50
  self.plot_type = plot_type
50
51
 
51
52
  @property
@@ -123,13 +124,15 @@ class Maidr:
123
124
  def _create_html_tag(self) -> Tag:
124
125
  """Create the MAIDR HTML using HTML tags."""
125
126
  tagged_elements = [element for plot in self._plots for element in plot.elements]
126
- with HighlightContextManager.set_maidr_elements(tagged_elements):
127
+ selector_ids = []
128
+ for i, plot in enumerate(self._plots):
129
+ for _ in plot.elements:
130
+ selector_ids.append(self.selector_ids[i])
131
+
132
+ with HighlightContextManager.set_maidr_elements(tagged_elements, selector_ids):
127
133
  svg = self._get_svg()
128
134
  maidr = f"\nlet maidr = {json.dumps(self._flatten_maidr(), indent=2)}\n"
129
135
 
130
- # In SVG we will replace maidr=id with the unique id.
131
- svg = svg.replace('maidr="true"', f'maidr="{self.selector_id}"')
132
-
133
136
  # Inject plot's svg and MAIDR structure into html tag.
134
137
  return Maidr._inject_plot(svg, maidr, self.maidr_id)
135
138
 
@@ -147,23 +150,30 @@ class Maidr:
147
150
  if self.plot_type in (PlotType.LINE, PlotType.DODGED, PlotType.STACKED):
148
151
  self._plots = [self._plots[0]]
149
152
  maidr = [plot.schema for plot in self._plots]
150
- for plot in maidr:
151
- if MaidrKey.SELECTOR in plot:
152
- plot[MaidrKey.SELECTOR] = plot[MaidrKey.SELECTOR].replace(
153
- "maidr='true'", f"maidr='{self.selector_id}'"
154
- )
153
+
155
154
  return maidr if len(maidr) != 1 else maidr[0]
156
155
 
157
156
  # Now let's start building the maidr object for the newer TypeScript engine
158
157
 
158
+ if self.plot_type in (PlotType.DODGED, PlotType.STACKED):
159
+ self._plots = [self._plots[0]]
160
+
159
161
  plot_schemas = []
160
162
 
161
- for plot in self._plots:
163
+ for i, plot in enumerate(self._plots):
162
164
  schema = plot.schema
165
+
163
166
  if MaidrKey.SELECTOR in schema:
164
- schema[MaidrKey.SELECTOR] = schema[MaidrKey.SELECTOR].replace(
165
- "maidr='true'", f"maidr='{self.selector_id}'"
166
- )
167
+ if isinstance(schema[MaidrKey.SELECTOR], str):
168
+ schema[MaidrKey.SELECTOR] = schema[MaidrKey.SELECTOR].replace(
169
+ "maidr='true'", f"maidr='{self.selector_ids[i]}'"
170
+ )
171
+ if isinstance(schema[MaidrKey.SELECTOR], list):
172
+ for j in range(len(schema[MaidrKey.SELECTOR])):
173
+ schema[MaidrKey.SELECTOR][j] = schema[MaidrKey.SELECTOR][
174
+ j
175
+ ].replace("maidr='true'", f"maidr='{self.selector_ids[i]}'")
176
+
167
177
  plot_schemas.append(
168
178
  {
169
179
  "schema": schema,
@@ -211,10 +221,6 @@ class Maidr:
211
221
  root_svg = None
212
222
  # Find the `svg` tag and set unique id if not present else use it.
213
223
  for element in tree_svg.iter(tag="{http://www.w3.org/2000/svg}svg"):
214
- _id = Maidr._unique_id()
215
- self._set_maidr_id(_id)
216
- if "id" not in element.attrib:
217
- element.attrib["id"] = _id
218
224
  if "maidr-data" not in element.attrib:
219
225
  element.attrib["maidr-data"] = json.dumps(
220
226
  self._flatten_maidr(), indent=2
@@ -68,7 +68,6 @@ class BarPlot(MaidrPlot, ContainerExtractorMixin, LevelExtractorMixin, DictMerge
68
68
  if len(plot) != len(level):
69
69
  return None
70
70
 
71
- # Tag the elements for highlighting.
72
71
  self._elements.extend(plot)
73
72
 
74
73
  return [float(patch.get_height()) for patch in plot]
@@ -138,22 +138,6 @@ class BoxPlot(
138
138
  box_orientation = {MaidrKey.ORIENTATION: self._orientation}
139
139
  return DictMergerMixin.merge_dict(base_schema, box_orientation)
140
140
 
141
- def _extract_axes_data(self) -> dict:
142
- base_ax_schema = super()._extract_axes_data()
143
- if self._orientation == "vert":
144
- box_ax_schema = {
145
- MaidrKey.X: {
146
- MaidrKey.LEVEL: self.extract_level(self.ax, MaidrKey.X),
147
- },
148
- }
149
- else:
150
- box_ax_schema = {
151
- MaidrKey.Y: {
152
- MaidrKey.LEVEL: self.extract_level(self.ax, MaidrKey.Y),
153
- }
154
- }
155
- return self.merge_dict(base_ax_schema, box_ax_schema)
156
-
157
141
  def _extract_plot_data(self) -> list:
158
142
  data = self._extract_bxp_maidr(self._bxp_stats)
159
143
 
@@ -171,17 +155,27 @@ class BoxPlot(
171
155
  caps = self._bxp_extractor.extract_caps(bxp_stats["caps"])
172
156
  medians = self._bxp_extractor.extract_medians(bxp_stats["medians"])
173
157
  outliers = self._bxp_extractor.extract_outliers(bxp_stats["fliers"], caps)
174
-
175
- for whisker, cap, median, outlier in zip(whiskers, caps, medians, outliers):
158
+ levels = (
159
+ self.extract_level(self.ax, MaidrKey.X)
160
+ if self._orientation == "vert"
161
+ else self.extract_level(self.ax, MaidrKey.Y)
162
+ )
163
+ if levels is None:
164
+ levels = []
165
+
166
+ for whisker, cap, median, outlier, level in zip(
167
+ whiskers, caps, medians, outliers, levels
168
+ ):
176
169
  bxp_maidr.append(
177
170
  {
178
- MaidrKey.LOWER_OUTLIER.value: outlier["lower_outlier"],
171
+ MaidrKey.LOWER_OUTLIER.value: outlier[MaidrKey.LOWER_OUTLIER.value],
179
172
  MaidrKey.MIN.value: cap["min"],
180
173
  MaidrKey.Q1.value: whisker["q1"],
181
174
  MaidrKey.Q2.value: median,
182
175
  MaidrKey.Q3.value: whisker["q3"],
183
176
  MaidrKey.MAX.value: cap["max"],
184
- MaidrKey.UPPER_OUTLIER.value: outlier["upper_outlier"],
177
+ MaidrKey.UPPER_OUTLIER.value: outlier[MaidrKey.UPPER_OUTLIER.value],
178
+ MaidrKey.FILL.value: level,
185
179
  }
186
180
  )
187
181
 
@@ -23,13 +23,9 @@ class GroupedBarPlot(
23
23
  def _extract_axes_data(self) -> dict:
24
24
  base_ax_schema = super()._extract_axes_data()
25
25
  grouped_ax_schema = {
26
- MaidrKey.X.value: {
27
- MaidrKey.LEVEL.value: self.extract_level(self.ax, MaidrKey.X),
28
- },
29
- MaidrKey.FILL.value: {
30
- MaidrKey.LABEL.value: "Fill",
31
- MaidrKey.LEVEL.value: self.extract_level(self.ax, MaidrKey.FILL),
32
- },
26
+ MaidrKey.X.value: self.ax.get_xlabel(),
27
+ MaidrKey.Y.value: self.ax.get_ylabel(),
28
+ MaidrKey.FILL.value: self.extract_level(self.ax, MaidrKey.FILL),
33
29
  }
34
30
  return self.merge_dict(base_ax_schema, grouped_ax_schema)
35
31
 
@@ -54,14 +50,15 @@ class GroupedBarPlot(
54
50
  for container in plot:
55
51
  if len(x_level) != len(container.patches):
56
52
  return None
57
-
53
+ container_data = []
58
54
  for x, y in zip(x_level, container.patches):
59
- data.append(
55
+ container_data.append(
60
56
  {
61
57
  MaidrKey.X.value: x,
62
58
  MaidrKey.FILL.value: container.get_label(),
63
59
  MaidrKey.Y.value: float(y.get_height()),
64
60
  }
65
61
  )
62
+ data.append(container_data)
66
63
 
67
64
  return data
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import numpy.ma as ma
4
-
5
4
  from matplotlib.axes import Axes
6
5
  from matplotlib.cm import ScalarMappable
7
6
  from matplotlib.collections import QuadMesh
@@ -36,23 +35,24 @@ class HeatPlot(
36
35
  def _extract_axes_data(self) -> dict:
37
36
  base_ax_schema = super()._extract_axes_data()
38
37
  heat_ax_schema = {
39
- MaidrKey.X: {
40
- MaidrKey.LEVEL: self.extract_level(self.ax, MaidrKey.X),
41
- },
42
- MaidrKey.Y: {
43
- MaidrKey.LEVEL: self.extract_level(self.ax, MaidrKey.Y),
44
- },
38
+ MaidrKey.X: self.ax.get_xlabel(),
39
+ MaidrKey.Y: self.ax.get_ylabel(),
40
+ MaidrKey.FILL: self._fill_label,
45
41
  }
46
42
  return self.merge_dict(base_ax_schema, heat_ax_schema)
47
43
 
48
- def _extract_plot_data(self) -> list[list]:
44
+ def _extract_plot_data(self) -> dict:
49
45
  plot = self.extract_scalar_mappable(self.ax)
50
46
  data = self._extract_scalar_mappable_data(plot)
51
47
 
52
48
  if data is None:
53
49
  raise ExtractionError(self.type, plot)
54
50
 
55
- return data
51
+ return {
52
+ MaidrKey.POINTS: data,
53
+ MaidrKey.X: self.extract_level(self.ax, MaidrKey.X),
54
+ MaidrKey.Y: self.extract_level(self.ax, MaidrKey.Y),
55
+ }
56
56
 
57
57
  def _extract_scalar_mappable_data(
58
58
  self, sm: ScalarMappable | None
@@ -42,8 +42,10 @@ class MultiLinePlot(MaidrPlot, LineExtractorMixin):
42
42
  def __init__(self, ax: Axes, **kwargs):
43
43
  super().__init__(ax, PlotType.LINE)
44
44
 
45
- def _get_selector(self) -> str:
46
- return "g[maidr='true'] > path"
45
+ def _get_selector(self) -> str | list[str]:
46
+ if Environment.get_engine() == "js":
47
+ return "g[maidr='true'] > path"
48
+ return ["g[maidr='true'] > path"]
47
49
 
48
50
  def _extract_plot_data(self) -> list[dict]:
49
51
  plot = self.extract_lines(self.ax)
@@ -66,7 +66,7 @@ class MaidrPlot(ABC):
66
66
 
67
67
  def _get_selector(self) -> str:
68
68
  """Return the CSS selector for highlighting elements."""
69
- return "path[maidr='true']"
69
+ return "g[maidr='true'] > path"
70
70
 
71
71
  def _extract_axes_data(self) -> dict:
72
72
  """Extract the plot's axes data"""
@@ -7,6 +7,7 @@ from matplotlib.collections import PathCollection
7
7
  from maidr.core.enum import MaidrKey, PlotType
8
8
  from maidr.core.plot import MaidrPlot
9
9
  from maidr.exception import ExtractionError
10
+ from maidr.util.environment import Environment
10
11
  from maidr.util.mixin import CollectionExtractorMixin
11
12
 
12
13
 
@@ -14,8 +15,10 @@ class ScatterPlot(MaidrPlot, CollectionExtractorMixin):
14
15
  def __init__(self, ax: Axes) -> None:
15
16
  super().__init__(ax, PlotType.SCATTER)
16
17
 
17
- def _get_selector(self) -> str:
18
- return "g[maidr='true'] > use"
18
+ def _get_selector(self) -> str | list[str]:
19
+ if Environment.get_engine() == "js":
20
+ return "g[maidr='true'] > use"
21
+ return ["g[maidr='true'] > use"]
19
22
 
20
23
  def _extract_plot_data(self) -> list[dict]:
21
24
  plot = self.extract_collection(self.ax, PathCollection)
@@ -35,12 +38,8 @@ class ScatterPlot(MaidrPlot, CollectionExtractorMixin):
35
38
 
36
39
  return [
37
40
  {
38
- "points": [
39
- {
40
- MaidrKey.X: float(x),
41
- MaidrKey.Y: float(y),
42
- }
43
- for x, y in ma.getdata(plot.get_offsets())
44
- ]
41
+ MaidrKey.X: float(x),
42
+ MaidrKey.Y: float(y),
45
43
  }
44
+ for x, y in ma.getdata(plot.get_offsets())
46
45
  ]
@@ -1,24 +1,28 @@
1
1
  from __future__ import annotations
2
2
 
3
- import wrapt
3
+ import uuid
4
4
 
5
+ import wrapt
6
+ from matplotlib.backends.backend_svg import XMLWriter
5
7
  from matplotlib.collections import PathCollection, QuadMesh
8
+ from matplotlib.figure import Figure
6
9
  from matplotlib.lines import Line2D
7
10
  from matplotlib.patches import Patch
8
- from matplotlib.backends.backend_svg import XMLWriter
9
11
 
10
12
  from maidr.core.context_manager import HighlightContextManager
11
13
 
12
14
 
13
15
  @wrapt.patch_function_wrapper(XMLWriter, "start")
14
- def inject_maidr_attribute(wrapped, _, args, kwargs):
15
- if HighlightContextManager.is_maidr_element():
16
- kwargs["maidr"] = "true"
16
+ def inject_maidr_attribute(wrapped, instance, args, kwargs):
17
+ if HighlightContextManager.is_maidr_element(kwargs.get("id")):
18
+ kwargs["maidr"] = HighlightContextManager.get_selector_id(kwargs.get("id"))
17
19
  return wrapped(*args, **kwargs)
18
20
 
19
21
 
20
22
  def tag_elements(wrapped, instance, args, kwargs):
21
- with HighlightContextManager.set_maidr_element(instance):
23
+ id = str(uuid.uuid4())
24
+ instance.set_gid(id)
25
+ with HighlightContextManager.set_maidr_element(instance, id):
22
26
  return wrapped(*args, **kwargs)
23
27
 
24
28
 
@@ -4,7 +4,7 @@ from typing import Literal
4
4
 
5
5
 
6
6
  class Environment:
7
- _engine = "js"
7
+ _engine = "ts"
8
8
 
9
9
  @classmethod
10
10
  def _set_engine(cls, engine: Literal["js", "ts"]) -> None:
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "maidr"
7
- version = "0.19.1"
7
+ version = "0.21.0"
8
8
  description = "Multimodal Access and Interactive Data Representations"
9
9
  authors = [
10
10
  "JooYoung Seo <jseo1005@illinois.edu>",
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