Add sparkline widget. (#2631)

* Sparkline widget proof of concept.

* Address review comment.

Related comments: https://github.com/Textualize/textual/pull/2631\#discussion_r1202894414

* Blend background colours.

* Add widget sparkline.

* Add snapshot tests.

* Add documentation.

* Update roadmap.

* Address review feedback.

Relevant comments: https://github.com/Textualize/textual/pull/2631\#discussion_r1210394532, https://github.com/Textualize/textual/pull/2631\#discussion_r1210442013

* Improve docs.

Relevant comments: https://github.com/Textualize/textual/pull/2631\#issuecomment-1568529074

* Update snapshot app titles.

* Don't init summary function with None

Related comments: https://github.com/Textualize/textual/pull/2631\#discussion_r1211666076

* Apply suggestions from code review

Co-authored-by: Dave Pearson <davep@davep.org>

* Improve wording.

* Improve wording.

* Simplify example.

---------

Co-authored-by: Dave Pearson <davep@davep.org>
This commit is contained in:
Rodrigo Girão Serrão
2023-06-01 09:34:33 +01:00
committed by GitHub
parent 7049014faa
commit 78db024c01
16 changed files with 918 additions and 3 deletions

View File

@@ -279,6 +279,14 @@ def test_select_expanded_changed(snap_compare):
)
def test_sparkline_render(snap_compare):
assert snap_compare(WIDGET_EXAMPLES_DIR / "sparkline.py")
def test_sparkline_component_classes_colors(snap_compare):
assert snap_compare(WIDGET_EXAMPLES_DIR / "sparkline_colors.py")
# --- CSS properties ---
# We have a canonical example for each CSS property that is shown in their docs.
# If any of these change, something has likely broken, so snapshot each of them.