uplot-python 1.1.0__py3-none-any.whl → 1.1.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.
uplot/__init__.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  """Python wrapper for μPlot time series."""
7
7
 
8
- __version__ = "1.1.0"
8
+ __version__ = "1.1.1"
9
9
 
10
10
  from .plot import plot
11
11
  from .plot2 import plot2
uplot/color_picker.py CHANGED
@@ -36,7 +36,7 @@ class ColorPicker:
36
36
  Returns:
37
37
  Color string.
38
38
  """
39
- color = self.COLORS[self.__next_color]
39
+ color = self.COLORS[self.__next_color % len(self.COLORS)]
40
40
  self.__next_color += 1
41
41
  return color
42
42
 
uplot/plot2.py CHANGED
@@ -17,8 +17,21 @@ from .utils import js
17
17
  from .write_html_tempfile import write_html_tempfile
18
18
 
19
19
 
20
- def prepare_data(x, left, right):
21
- """Combine x, left-axis, and right-axis arrays into a flat data list."""
20
+ def prepare_data(
21
+ x: np.ndarray,
22
+ left: List[np.ndarray],
23
+ right: Optional[List[np.ndarray]],
24
+ ) -> List[np.ndarray]:
25
+ """Prepare the data list from x-axis, left, and right series.
26
+
27
+ Args:
28
+ x: Values for the x-axis.
29
+ left: Left y-axis series (single array or list of arrays).
30
+ right: Optional right y-axis series.
31
+
32
+ Returns:
33
+ Combined list of arrays for all series.
34
+ """
22
35
  if isinstance(left, np.ndarray) and left.ndim == 1:
23
36
  left = [left]
24
37
  data = [x, *left]
@@ -28,7 +41,11 @@ def prepare_data(x, left, right):
28
41
 
29
42
 
30
43
  def add_default_options(opts: dict) -> None:
31
- """Populate cursor drag and wheel-zoom plugin defaults when absent."""
44
+ """Add default cursor and plugin options if not already set.
45
+
46
+ Args:
47
+ opts: uPlot option dictionary to update in place.
48
+ """
32
49
  if "cursor" not in opts:
33
50
  opts["cursor"] = {
34
51
  "drag": {
@@ -50,7 +67,18 @@ def add_series(
50
67
  left_labels: Optional[List[str]],
51
68
  right_labels: Optional[List[str]],
52
69
  ) -> None:
53
- """Build the uPlot series list and attach it to opts."""
70
+ """Build the uPlot series list and attach it to opts.
71
+
72
+ Args:
73
+ opts: uPlot option dictionary to update in place.
74
+ data: List of data arrays (x-axis followed by series).
75
+ nb_left: Number of left-axis series.
76
+ left_labels: Optional labels for left-axis series.
77
+ right_labels: Optional labels for right-axis series.
78
+
79
+ Raises:
80
+ UplotException: If left_labels has fewer entries than nb_left.
81
+ """
54
82
  if left_labels is not None and len(left_labels) < nb_left:
55
83
  raise UplotException(
56
84
  f"Not enough labels in left_labels ({len(left_labels)}) "
@@ -97,7 +125,11 @@ def add_series(
97
125
 
98
126
 
99
127
  def add_axes(opts: dict) -> None:
100
- """Add default left and right axis definitions to opts."""
128
+ """Add default left and right axis definitions to opts.
129
+
130
+ Args:
131
+ opts: uPlot option dictionary to update in place.
132
+ """
101
133
  opts["axes"] = [
102
134
  {},
103
135
  {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uplot-python
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: Python wrapper for μPlot time series.
5
5
  Keywords: json,time,series,plot
6
6
  Author-email: Stéphane Caron <stephane.caron@normalesup.org>
@@ -19,7 +19,7 @@ License-File: LICENSE
19
19
  Requires-Dist: ipython >=8.0.1
20
20
  Requires-Dist: msgpack >=1.0.4
21
21
  Requires-Dist: numpy >=1.15.4
22
- Project-URL: Changelog, https://codeberg.org/stephane-caron/uplot-python/blob/master/CHANGELOG.md
22
+ Project-URL: Changelog, https://codeberg.org/stephane-caron/uplot-python/src/branch/main/CHANGELOG.md
23
23
  Project-URL: Homepage, https://codeberg.org/stephane-caron/uplot-python
24
24
  Project-URL: Source, https://codeberg.org/stephane-caron/uplot-python
25
25
  Project-URL: Tracker, https://codeberg.org/stephane-caron/uplot-python/issues
@@ -78,6 +78,7 @@ uplot.plot2(
78
78
  ## See also
79
79
 
80
80
  - [µPlot](https://github.com/leeoniya/uPlot): A small (~45 KB min), fast chart for time series, lines, areas, ohlc & bars.
81
+ - [foxplot](https://codeberg.org/stephane-caron/foxplot): Plot time series from MessagePack or line-delimited JSON.
81
82
  - [Matplotlib](https://matplotlib.org/stable/): Comprehensive library for creating static, animated, and interactive visualizations.
82
83
  - [matplotlive](https://codeberg.org/stephane-caron/matplotlive): Stream live plots to a Matplotlib figure.
83
84
 
@@ -1,16 +1,16 @@
1
- uplot/__init__.py,sha256=FRPhRJ7xLuJLzle7fMRkAKoDbTzapOw5HxwJHkYBTMY,245
2
- uplot/color_picker.py,sha256=FdA7Jd6mMungX9UuvJ9syYjvCcQJ9--LdxTBj-te0v8,901
1
+ uplot/__init__.py,sha256=P8nHtlHy0naNFymrwMmGEVksGKV9z1v1QU_nwtffD2s,245
2
+ uplot/color_picker.py,sha256=TgE1o8V5zGor0Znasmm6zggXdgqh0nk9L1I4wtxOpug,920
3
3
  uplot/exceptions.py,sha256=8_2xggNkMpMF-pRsfA8kLWT81l_t2cZ4cfOkwbPql_4,192
4
4
  uplot/generate_html.py,sha256=NruX2zDzzTIOuJW4lQ6N60kg05MAH61eWEAijcFKhr0,3713
5
5
  uplot/plot.py,sha256=MOGxCDlYdH-n6f380_3wmYCdfjwtU438AtcFYZ4gdiQ,643
6
- uplot/plot2.py,sha256=P5tOyZxsm65mG1DN3TSK2q4qWBOk2GJPBcWx0xXz9Ks,4887
6
+ uplot/plot2.py,sha256=oZMruYuAMPQL6-FDv5m2wAy_NVa74PmkjXHN1i1Dln8,5723
7
7
  uplot/utils.py,sha256=Tl6ZDtMdtE27PuX3Vje_IQjhZZg40BcfmlXcU02o_Nc,880
8
8
  uplot/write_html_tempfile.py,sha256=B68PrF3rQ3mC3i6ujKgHy8cf8V64h4D9DxIqkGdLRQI,661
9
9
  uplot/static/__init__.py,sha256=1mykIjCDK2TC5EfbjCTNxfOtJx3P-hIFgbHQEtBfM_o,71
10
10
  uplot/static/uPlot.iife.js,sha256=ZVvIqjN4Hochxa9rWfFpnAPJvalRqnSmq1GKwgzEMm0,120184
11
11
  uplot/static/uPlot.min.css,sha256=PxIc1KmXtjTgeoh2WIUAGOR1wm8L3dh0EJqNOCwZ3oc,1839
12
12
  uplot/static/uPlot.mousewheel.js,sha256=p2CcCwxxafvNqXsxw-zrqUUogxZ1URZhxWK59B0-tgw,4543
13
- uplot_python-1.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
- uplot_python-1.1.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
15
- uplot_python-1.1.0.dist-info/METADATA,sha256=IUFfatQ54RV4rz5-L8r3Y1jEZtMfxFP4G_M7oKdHBk0,2812
16
- uplot_python-1.1.0.dist-info/RECORD,,
13
+ uplot_python-1.1.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
+ uplot_python-1.1.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
15
+ uplot_python-1.1.1.dist-info/METADATA,sha256=fixZpQvCiTf3bI1cYRvF2GpRJeLt6QA94gcKxHuATvM,2933
16
+ uplot_python-1.1.1.dist-info/RECORD,,