|
@@ -1,4 +1,5 @@
|
|
|
// TODO(doc): document TUI lifecycle
|
|
// TODO(doc): document TUI lifecycle
|
|
|
|
|
+// TODO(test): write unittests for types.go
|
|
|
package tui
|
|
package tui
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
@@ -62,10 +63,14 @@ func (m Model) content() string {
|
|
|
} else if m.viewport.Width != 0 && m.viewport.Height != 0 {
|
|
} else if m.viewport.Width != 0 && m.viewport.Height != 0 {
|
|
|
output = output + fmt.Sprintf("\n%s", blockStyle.Render(headerStyle.Render(address.Address)))
|
|
output = output + fmt.Sprintf("\n%s", blockStyle.Render(headerStyle.Render(address.Address)))
|
|
|
|
|
|
|
|
- // Linechart
|
|
|
|
|
|
|
+ // Linechart // TODO(complexity): too many if branches
|
|
|
var slc streamlinechart.Model
|
|
var slc streamlinechart.Model
|
|
|
if m.ChartHeight == 0 {
|
|
if m.ChartHeight == 0 {
|
|
|
- slc = streamlinechart.New(m.width, m.viewport.Height-9)
|
|
|
|
|
|
|
+ if len(m.Addresses) > 1 {
|
|
|
|
|
+ slc = streamlinechart.New(m.width, m.viewport.Height-9)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ slc = streamlinechart.New(m.width, m.viewport.Height-4)
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
slc = streamlinechart.New(m.width, m.ChartHeight)
|
|
slc = streamlinechart.New(m.width, m.ChartHeight)
|
|
|
}
|
|
}
|