plots and stuff (#3231)

Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
James Simmons
2022-11-03 16:09:42 -04:00
committed by GitHub
parent 5debfb4d0d
commit 58a36d24b7
3 changed files with 19 additions and 8 deletions

View File

@@ -135,7 +135,8 @@ class OnchainController(BaseController):
"--since": None,
"-s": "--since",
}
choices["ttcp"] = {c: {} for c in bitquery_model.DECENTRALIZED_EXCHANGES}
choices["baas"]["-c"] = {c: {} for c in bitquery_model.POSSIBLE_CRYPTOS}
choices["baas"]["--coin"] = {c: {} for c in bitquery_model.POSSIBLE_CRYPTOS}
choices["balance"] = {
"--sort": {c: None for c in ethplorer_model.BALANCE_FILTERS},
"-s": "--sort",
@@ -224,7 +225,10 @@ class OnchainController(BaseController):
"-s": "--sort",
"--descend": {},
}
choices["ttcp"] = {c: {} for c in bitquery_model.DECENTRALIZED_EXCHANGES}
choices["ttcp"]["--exchanges"] = {
c: {} for c in bitquery_model.DECENTRALIZED_EXCHANGES
}
choices["ttcp"]["-e"] = "--exchanges"
choices["ttcp"]["--sort"] = {c: None for c in bitquery_model.TTCP_FILTERS}
choices["ttcp"]["-s"] = "--sort"
choices["ttcp"]["--days"] = {str(c): {} for c in range(1, 100)}
@@ -1472,7 +1476,7 @@ class OnchainController(BaseController):
parser.add_argument(
"--descend",
action="store_false",
action="store_true",
help="Flag to sort in descending order (lowest first)",
dest="descend",
default=False,

View File

@@ -200,9 +200,10 @@ class OverviewController(BaseController):
"--urls": {},
"-u": "--urls",
}
choices["contracts"] = {
choices["contracts"]["--platform"] = {
c: None for c in get_all_contract_platforms()["platform_id"].tolist()
}
choices["contracts"]["-p"] = "--platform"
choices["contracts"]["--sortby"] = {
c: None for c in coinpaprika_model.CONTRACTS_FILTERS
}
@@ -210,7 +211,8 @@ class OverviewController(BaseController):
choices["contracts"]["--limit"] = {str(c): {} for c in range(1, 100)}
choices["contracts"]["-l"] = "--limit"
choices["contracts"]["--descend"] = {}
choices["hm"] = {c: {} for c in get_categories_keys()}
choices["hm"]["--category"] = {c: {} for c in get_categories_keys()}
choices["hm"]["-c"] = "--category"
choices["hm"]["--limit"] = {str(c): {} for c in range(1, 100)}
choices["hm"]["-l"] = "--limit"
choices["info"] = {

View File

@@ -158,8 +158,10 @@ def display_holdings_overview(
for _, row in df.iterrows():
ax.bar(x=row["Symbol"], height=row["Total Holdings"])
ax.set_ylabel("BTC Number")
if symbol == "bitcoin":
ax.set_ylabel("BTC Number")
else:
ax.set_ylabel("ETH Number")
ax.get_yaxis().set_major_formatter(
ticker.FuncFormatter(
lambda x, _: lambda_long_number_format_with_type_check(x)
@@ -167,7 +169,10 @@ def display_holdings_overview(
)
ax.set_xlabel("Company Symbol")
fig.tight_layout(pad=8)
ax.set_title("Total BTC Holdings per company")
if symbol == "bitcoin":
ax.set_title("Total BTC Holdings per company")
else:
ax.set_title("Total ETH Holdings per company")
ax.tick_params(axis="x", labelrotation=90)
console.print(f"\n{stats_string}\n")
df = df.applymap(lambda x: lambda_long_number_format_with_type_check(x))