From 1ab50bcefc7572c57eaa4057e742bfcb0c0766dc Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Thu, 14 Feb 2019 23:44:11 -0500 Subject: [PATCH] Finished changes for BarChart and updated CHNAGELOG. --- CHANGELOG.md | 9 +++++++-- termdashdemo/termdashdemo.go | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa62215..58acbd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,8 +19,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Termbox is now initialized in 256 color mode by default. - Generalized mouse button FSM for use in widgets that need to track mouse button clicks. -- The constructor of the LineChart widget now also returns an error so that it - can validate its options. This is a breaking change on the LineChart API. + +#### Breaking API changes + +- The constructors of all the widgets now also return an error so that they + can validate the options. This is a breaking change for the following + widgets: BarChart, Gauge, SparkLine, Text. The callers will have to handle + the returned error. ### Fixed diff --git a/termdashdemo/termdashdemo.go b/termdashdemo/termdashdemo.go index 786338e..85a44a4 100644 --- a/termdashdemo/termdashdemo.go +++ b/termdashdemo/termdashdemo.go @@ -106,6 +106,11 @@ func layout(ctx context.Context, t terminalapi.Terminal) (*container.Container, ), } + bc, err := newBarChart(ctx) + if err != nil { + return nil, err + } + don, err := newDonut(ctx) if err != nil { return nil, err @@ -120,7 +125,7 @@ func layout(ctx context.Context, t terminalapi.Terminal) (*container.Container, container.Top( container.Border(draw.LineStyleLight), container.BorderTitle("BarChart"), - container.PlaceWidget(newBarChart(ctx)), + container.PlaceWidget(bc), container.BorderTitleAlignRight(), ), container.Bottom(