|
|
@@ -184,13 +184,14 @@ func (p Peak) View() tea.View {
|
|
|
|
|
|
var slc streamlinechart.Model
|
|
|
|
|
|
- if p.ChartHeight == 0 && len(p.Addresses) == 1 { // catch user specified fullscreen
|
|
|
+ if p.ChartHeight == 0 { // && len(p.Addresses) == 1 { // catch user specified fullscreen
|
|
|
// render chart at fullscreen
|
|
|
- slc = streamlinechart.New(p.Width, p.Height-1)
|
|
|
- } else if p.ChartHeight == 0 && len(p.Addresses) > 1 { // catch user specified fullscreen
|
|
|
+ slc = streamlinechart.New(p.Width, p.Height-3)
|
|
|
+ } else if p.ChartHeight == -1 && len(p.Addresses) > 1 { // catch user specified fullscreen
|
|
|
// render chart at fullscreen minus a few lines to hint at scrolling
|
|
|
- slc = streamlinechart.New(p.Width, p.Height-2)
|
|
|
- } else {
|
|
|
+ slc = streamlinechart.New(p.Width, p.getDynamicChartHeight()-1)
|
|
|
+ // slc = streamlinechart.New(p.Width, p.Height-2)
|
|
|
+ } else if p.ChartHeight >= 1 {
|
|
|
slc = streamlinechart.New(p.Width, p.ChartHeight-1) // DEPRECATE
|
|
|
}
|
|
|
|
|
|
@@ -222,3 +223,8 @@ func (p Peak) Poll() tea.Cmd {
|
|
|
}
|
|
|
return tea.Batch(cmds...)
|
|
|
}
|
|
|
+
|
|
|
+func (p Peak) getDynamicChartHeight() int {
|
|
|
+ nAddresses := len(p.Addresses)
|
|
|
+ return p.Height / nAddresses
|
|
|
+}
|