Skip to content

Commit

Permalink
correcting logging limits
Browse files Browse the repository at this point in the history
  • Loading branch information
jposada202020 committed Aug 12, 2023
1 parent 302ac15 commit 2dc3e61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
15 changes: 9 additions & 6 deletions circuitpython_uplot/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
CircuitPython logging data graph
* Author(s): Jose D. Montoya
* Author: Jose D. Montoya
"""
Expand Down Expand Up @@ -87,6 +87,8 @@ def __init__(
dtype=np.int16,
)
plot._plot_palette[9] = limits_color
else:
self._limits = None

self.draw_points(plot, x, y, fill)

Expand Down Expand Up @@ -163,7 +165,8 @@ def draw_points(self, plot: Plot, x: list, y: list, fill: bool = False) -> None:
:return: None
"""
self.clear_plot(plot)

if self._limits:
self._draw_limit_lines(plot)
self.draw_new_lines(plot, x, y, fill)

def draw_new_lines(self, plot: Plot, x: list, y: list, fill: bool = False) -> None:
Expand Down Expand Up @@ -215,17 +218,17 @@ def draw_new_lines(self, plot: Plot, x: list, y: list, fill: bool = False) -> No
def _draw_limit_lines(self, plot: Plot) -> None:
draw_line(
plot._plotbitmap,
plot._newxmin,
plot._newxmin + 1,
self._limits[0],
plot._newxmax,
plot._newxmax - 1,
self._limits[0],
9,
)
draw_line(
plot._plotbitmap,
plot._newxmin,
plot._newxmin + 1,
self._limits[1],
plot._newxmax,
plot._newxmax - 1,
self._limits[1],
9,
)
19 changes: 7 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,19 @@
# SPDX-License-Identifier: MIT

[build-system]
requires = [
"setuptools",
"wheel",
"setuptools-scm",
]
requires = ["setuptools", "wheel", "setuptools-scm"]

[project]
name = "circuitpython-uplot"
description = "framework to display different plots in displayio. similar to widget"
version = "0.0.0+auto.0"
readme = "README.rst"
authors = [
{name = "JDM", email = "uplot@mailmeto.mozmail.com"}
]
urls = {Homepage = "https://github.com/jposada202020/CircuitPython_uplot"}
authors = [{ name = "JDM", email = "uplot@mailmeto.mozmail.com" }]
urls = { Homepage = "https://github.com/jposada202020/CircuitPython_uplot" }
keywords = [
"circuitpython",
"uplot",
"microplot",
"bar",
"stackplot",
"fillbetween",
Expand All @@ -41,7 +36,7 @@ keywords = [
"plot",
"plotter",
]
license = {text = "MIT"}
license = { text = "MIT" }
classifiers = [
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
Expand All @@ -56,5 +51,5 @@ dynamic = ["dependencies", "optional-dependencies"]
packages = ["circuitpython_uplot"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}
dependencies = { file = ["requirements.txt"] }
optional-dependencies = { optional = { file = ["optional_requirements.txt"] } }

0 comments on commit 2dc3e61

Please sign in to comment.