|
|
@@ -71,14 +71,13 @@ func (m Model) content() string {
|
|
|
blockStyle.Render(headerStyle.Render(address.Address)))
|
|
|
}
|
|
|
|
|
|
- // Linechart // TODO(complexity): too many if branches
|
|
|
+ // Linechart
|
|
|
+ viewportHeight := m.viewport.Height - 4
|
|
|
var slc streamlinechart.Model
|
|
|
- if m.ChartHeight == 0 {
|
|
|
- if len(m.Addresses) > 1 {
|
|
|
- slc = streamlinechart.New(m.width, m.viewport.Height-9)
|
|
|
- } else {
|
|
|
- slc = streamlinechart.New(m.width, m.viewport.Height-4)
|
|
|
- }
|
|
|
+ if m.ChartHeight == 0 && len(m.Addresses) == 1 {
|
|
|
+ slc = streamlinechart.New(m.width, viewportHeight)
|
|
|
+ } else if m.ChartHeight == 0 && len(m.Addresses) > 1 {
|
|
|
+ slc = streamlinechart.New(m.width, viewportHeight-5)
|
|
|
} else {
|
|
|
slc = streamlinechart.New(m.width, m.ChartHeight)
|
|
|
}
|