mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
switch to fork of asciigraph
This commit is contained in:
parent
60a4c14707
commit
1b834401ed
7 changed files with 21 additions and 13 deletions
17
Gopkg.lock
generated
17
Gopkg.lock
generated
|
|
@ -17,13 +17,6 @@
|
||||||
pruneopts = "NUT"
|
pruneopts = "NUT"
|
||||||
revision = "5a71ef0e047df0427e87a79f27009029921f1f9b"
|
revision = "5a71ef0e047df0427e87a79f27009029921f1f9b"
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
digest = "1:8abef4b9ca2f94e008688685bf8fb7bb27e5c82b353a82ef9276a27b4a6d2020"
|
|
||||||
name = "github.com/carlosms/asciigraph"
|
|
||||||
packages = ["."]
|
|
||||||
pruneopts = "NUT"
|
|
||||||
revision = "22e3e1b9e3cd5ab4f79619cd65987f426d2d3dc4"
|
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:cd7ba2b29e93e2a8384e813dfc80ebb0f85d9214762e6ca89bb55a58092eab87"
|
digest = "1:cd7ba2b29e93e2a8384e813dfc80ebb0f85d9214762e6ca89bb55a58092eab87"
|
||||||
|
|
@ -120,6 +113,14 @@
|
||||||
pruneopts = "NUT"
|
pruneopts = "NUT"
|
||||||
revision = "fc0cef2ff331aebb24cd4e9ded7e20650f3d7006"
|
revision = "fc0cef2ff331aebb24cd4e9ded7e20650f3d7006"
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
branch = "master"
|
||||||
|
digest = "1:7b2ab5c6de135d57d3a594b53068e2712da4d376b2f78097dec7b46d18deaa78"
|
||||||
|
name = "github.com/jesseduffield/asciigraph"
|
||||||
|
packages = ["."]
|
||||||
|
pruneopts = "NUT"
|
||||||
|
revision = "6d88e39309eef29cc5c2ab279ec600465827cbac"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:f9d37b286259d069b0e12b1c9c2662dc51d0fe6c9257780412c43a7b05f8bc51"
|
digest = "1:f9d37b286259d069b0e12b1c9c2662dc51d0fe6c9257780412c43a7b05f8bc51"
|
||||||
|
|
@ -336,7 +337,6 @@
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
input-imports = [
|
input-imports = [
|
||||||
"github.com/acarl005/stripansi",
|
"github.com/acarl005/stripansi",
|
||||||
"github.com/carlosms/asciigraph",
|
|
||||||
"github.com/cloudfoundry/jibber_jabber",
|
"github.com/cloudfoundry/jibber_jabber",
|
||||||
"github.com/docker/docker/api/types",
|
"github.com/docker/docker/api/types",
|
||||||
"github.com/docker/docker/api/types/filters",
|
"github.com/docker/docker/api/types/filters",
|
||||||
|
|
@ -344,6 +344,7 @@
|
||||||
"github.com/fatih/color",
|
"github.com/fatih/color",
|
||||||
"github.com/go-errors/errors",
|
"github.com/go-errors/errors",
|
||||||
"github.com/heroku/rollrus",
|
"github.com/heroku/rollrus",
|
||||||
|
"github.com/jesseduffield/asciigraph",
|
||||||
"github.com/jesseduffield/gocui",
|
"github.com/jesseduffield/gocui",
|
||||||
"github.com/jesseduffield/pty",
|
"github.com/jesseduffield/pty",
|
||||||
"github.com/mcuadros/go-lookup",
|
"github.com/mcuadros/go-lookup",
|
||||||
|
|
|
||||||
|
|
@ -42,5 +42,5 @@
|
||||||
name = "github.com/spkg/bom"
|
name = "github.com/spkg/bom"
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/carlosms/asciigraph"
|
branch = "master"
|
||||||
revision = "22e3e1b9e3cd5ab4f79619cd65987f426d2d3dc4"
|
name = "github.com/jesseduffield/asciigraph"
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/carlosms/asciigraph"
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
|
"github.com/jesseduffield/asciigraph"
|
||||||
"github.com/jesseduffield/lazydocker/pkg/config"
|
"github.com/jesseduffield/lazydocker/pkg/config"
|
||||||
"github.com/jesseduffield/lazydocker/pkg/utils"
|
"github.com/jesseduffield/lazydocker/pkg/utils"
|
||||||
"github.com/mcuadros/go-lookup"
|
"github.com/mcuadros/go-lookup"
|
||||||
|
|
|
||||||
|
|
@ -40,14 +40,21 @@ func Plot(series []float64, options ...Option) string {
|
||||||
config.Offset = 3
|
config.Offset = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var min2 float64
|
||||||
|
var max2 float64
|
||||||
var ratio float64
|
var ratio float64
|
||||||
|
padding := 0.0 // if we set height to 10 but min and max are both 0, we need 10 units of padding
|
||||||
if interval != 0 {
|
if interval != 0 {
|
||||||
ratio = float64(config.Height) / interval
|
ratio = float64(config.Height) / interval
|
||||||
} else {
|
} else {
|
||||||
ratio = 1
|
ratio = 1
|
||||||
|
if config.Height > 0 {
|
||||||
|
padding = float64(config.Height)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
min2 := round(minimum * ratio)
|
|
||||||
max2 := round(maximum * ratio)
|
min2 = round(minimum * ratio)
|
||||||
|
max2 = round((maximum + padding) * ratio)
|
||||||
|
|
||||||
intmin2 := int(min2)
|
intmin2 := int(min2)
|
||||||
intmax2 := int(max2)
|
intmax2 := int(max2)
|
||||||
Loading…
Add table
Reference in a new issue