don't shorten y values

pull/15/head
Miguel Mota 6 years ago
parent a3e0b1470d
commit d3975c8981

@ -155,6 +155,7 @@ Key|Action
<kbd>a</kbd>|Sort table by *[a]vailable supply* <kbd>a</kbd>|Sort table by *[a]vailable supply*
<kbd>c</kbd>|Toggle [c]hart for highlighted coin <kbd>c</kbd>|Toggle [c]hart for highlighted coin
<kbd>f</kbd>|Toggle show favorites <kbd>f</kbd>|Toggle show favorites
<kbd>F</kbd>|Toggle show favorites
<kbd>g</kbd>|Go to first line of page (vim inspired) <kbd>g</kbd>|Go to first line of page (vim inspired)
<kbd>G</kbd>|Go to last line of page (vim inspired) <kbd>G</kbd>|Go to last line of page (vim inspired)
<kbd>h</kbd>|Go to previous page (vim inspired) <kbd>h</kbd>|Go to previous page (vim inspired)
@ -225,6 +226,7 @@ You can then configure the actions you want for each key:
enter = "toggle_row_chart" enter = "toggle_row_chart"
esc = "quit" esc = "quit"
f = "toggle_show_favorites" f = "toggle_show_favorites"
F = "toggle_show_favorites"
F1 = "help" F1 = "help"
g = "move_to_page_first_row" g = "move_to_page_first_row"
h = "previous_page" h = "previous_page"

@ -68,7 +68,8 @@ func (ct *Cointop) chartPoints(maxX int, coin string) error {
return nil return nil
} }
for i := range graphData.MarketCapByAvailableSupply { for i := range graphData.MarketCapByAvailableSupply {
data = append(data, graphData.MarketCapByAvailableSupply[i][1]/1E9) price := graphData.MarketCapByAvailableSupply[i][1]
data = append(data, price/1E9)
} }
} else { } else {
graphData, err := ct.api.GetCoinGraphData(coin, start, end) graphData, err := ct.api.GetCoinGraphData(coin, start, end)
@ -76,7 +77,8 @@ func (ct *Cointop) chartPoints(maxX int, coin string) error {
return nil return nil
} }
for i := range graphData.PriceUSD { for i := range graphData.PriceUSD {
data = append(data, graphData.PriceUSD[i][1]) price := graphData.PriceUSD[i][1]
data = append(data, price)
} }
} }

@ -48,6 +48,7 @@ type Cointop struct {
config config // toml config config config // toml config
searchfield *gocui.View searchfield *gocui.View
searchfieldviewname string searchfieldviewname string
searchfieldvisible bool
favorites map[string]bool favorites map[string]bool
filterByFavorites bool filterByFavorites bool
savemux sync.Mutex savemux sync.Mutex
@ -128,7 +129,7 @@ func Run() {
} }
func (ct *Cointop) quit() error { func (ct *Cointop) quit() error {
if ct.helpvisible { if ct.helpvisible || ct.searchfieldvisible {
return nil return nil
} }

@ -8,11 +8,13 @@ import (
) )
func (ct *Cointop) openSearch() error { func (ct *Cointop) openSearch() error {
ct.searchfieldvisible = true
ct.setActiveView(ct.searchfieldviewname) ct.setActiveView(ct.searchfieldviewname)
return nil return nil
} }
func (ct *Cointop) cancelSearch() error { func (ct *Cointop) cancelSearch() error {
ct.searchfieldvisible = false
ct.setActiveView(ct.tableviewname) ct.setActiveView(ct.tableviewname)
return nil return nil
} }

@ -34,6 +34,7 @@ func defaultShortcuts() map[string]string {
"a": "sort_column_available_supply", "a": "sort_column_available_supply",
"c": "toggle_row_chart", "c": "toggle_row_chart",
"f": "toggle_show_favorites", "f": "toggle_show_favorites",
"F": "toggle_show_favorites",
"g": "move_to_page_first_row", "g": "move_to_page_first_row",
"G": "move_to_page_last_row", "G": "move_to_page_last_row",
"h": "previous_page", "h": "previous_page",

@ -183,7 +183,8 @@ func (lc *LineChart) calcLabelX() {
func shortenFloatVal(x float64) string { func shortenFloatVal(x float64) string {
s := fmt.Sprintf("%.2f", x) s := fmt.Sprintf("%.2f", x)
if len(s)-3 > 3 { if len(s)-3 > 3 {
s = fmt.Sprintf("%.2e", x) // don't shorten
//s = fmt.Sprintf("%.2e", x)
} }
if x < 0 { if x < 0 {

Loading…
Cancel
Save