Skip to content

Fix documentation errors #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions adafruit_display_shapes/sparkline.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@

class Sparkline(displayio.Group):
# pylint: disable=too-many-arguments
""" A sparkline graph.

: param width: Width of the sparkline graph in pixels
: param height: Height of the sparkline graph in pixels
: param max_items: Maximum number of values housed in the sparkline
: param y_min: Lower range for the y-axis. Set to None for autorange.
: param y_max: Upper range for the y-axis. Set to None for autorange.
: param x: X-position on the screen, in pixels
: param y: Y-position on the screen, in pixels
: param color: Line color, the default value is 0xFFFFFF (WHITE)
"""A sparkline graph.

:param width: Width of the sparkline graph in pixels
:param height: Height of the sparkline graph in pixels
:param max_items: Maximum number of values housed in the sparkline
:param y_min: Lower range for the y-axis. Set to None for autorange.
:param y_max: Upper range for the y-axis. Set to None for autorange.
:param x: X-position on the screen, in pixels
:param y: Y-position on the screen, in pixels
:param color: Line color, the default value is 0xFFFFFF (WHITE)
"""

def __init__(
Expand Down Expand Up @@ -86,8 +86,8 @@ def __init__(
) # self is a group of lines

def add_value(self, value):
""" Add a value to the sparkline.
: param value: The value to be added to the sparkline
"""Add a value to the sparkline.
:param value: The value to be added to the sparkline
"""

if value is not None:
Expand Down Expand Up @@ -123,9 +123,7 @@ def _plotline(self, x_1, last_value, x_2, value, y_bottom, y_top):
# pylint: disable= too-many-branches, too-many-nested-blocks

def update(self):
"""Update the drawing of the sparkline

"""
"""Update the drawing of the sparkline."""

# get the y range
if self.y_min is None:
Expand Down Expand Up @@ -212,7 +210,6 @@ def update(self):
last_value = value # store value for the next iteration

def values(self):
"""Returns the values displayed on the sparkline
"""
"""Returns the values displayed on the sparkline."""

return self._spark_list
3 changes: 2 additions & 1 deletion examples/display_shapes_sparkline_ticks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
import board
import displayio
import terminalio
from adafruit_display_text import label
from adafruit_display_shapes.sparkline import Sparkline
from adafruit_display_shapes.line import Line
from adafruit_display_shapes.rect import Rect
from adafruit_display_text import label


if "DISPLAY" not in dir(board):
# Setup the LCD display with driver
Expand Down
3 changes: 2 additions & 1 deletion examples/display_shapes_sparkline_triple.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
import board
import displayio
import terminalio
from adafruit_display_shapes.sparkline import Sparkline
from adafruit_display_text import label
from adafruit_display_shapes.sparkline import Sparkline


if "DISPLAY" not in dir(board):
# Setup the LCD display with driver
Expand Down