diff --git a/openbb_terminal/common/behavioural_analysis/finbrain_view.py b/openbb_terminal/common/behavioural_analysis/finbrain_view.py index a046224328d4..fa9ff91495f4 100644 --- a/openbb_terminal/common/behavioural_analysis/finbrain_view.py +++ b/openbb_terminal/common/behavioural_analysis/finbrain_view.py @@ -137,4 +137,4 @@ def display_sentiment_analysis( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/cryptocurrency/due_diligence/finbrain_crypto_view.py b/openbb_terminal/cryptocurrency/due_diligence/finbrain_crypto_view.py index 686015346847..06864a617d2d 100644 --- a/openbb_terminal/cryptocurrency/due_diligence/finbrain_crypto_view.py +++ b/openbb_terminal/cryptocurrency/due_diligence/finbrain_crypto_view.py @@ -135,4 +135,4 @@ def display_crypto_sentiment_analysis( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py b/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py index 69d472a6f01f..133891a55d93 100644 --- a/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py +++ b/openbb_terminal/cryptocurrency/nft/nftpricefloor_view.py @@ -165,4 +165,4 @@ def display_floor_price( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/cryptocurrency/onchain/shroom_view.py b/openbb_terminal/cryptocurrency/onchain/shroom_view.py index 5e9f2d1606f6..0f87e1a6ed50 100644 --- a/openbb_terminal/cryptocurrency/onchain/shroom_view.py +++ b/openbb_terminal/cryptocurrency/onchain/shroom_view.py @@ -126,7 +126,7 @@ def display_dapp_stats( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) diff --git a/openbb_terminal/cryptocurrency/overview/blockchaincenter_view.py b/openbb_terminal/cryptocurrency/overview/blockchaincenter_view.py index ec4b08e59736..496e6957762f 100644 --- a/openbb_terminal/cryptocurrency/overview/blockchaincenter_view.py +++ b/openbb_terminal/cryptocurrency/overview/blockchaincenter_view.py @@ -57,24 +57,13 @@ def display_altcoin_index( fig.set_title(f"Altcoin Index (Performance based on {period} days)") fig.add_scatter(x=df.index, y=df["Value"], mode="lines", name="Altcoin Index") - fig.add_hline( - y=75, - line_color=theme.up_color, - annotation=dict( - text="Altcoin Season (75)", - x=0.5, - xanchor="center", - ), + fig.add_hline_legend( + y=75, line=dict(color=theme.up_color), name="Altcoin Season (75)" ) - fig.add_hline( + fig.add_hline_legend( y=25, - line_color=theme.down_color, - annotation=dict( - text="Bitcoin Season (25)", - x=0.5, - xanchor="center", - yshift=-30, - ), + line=dict(color=theme.down_color), + name="Bitcoin Season (25)", ) export_data( diff --git a/openbb_terminal/dashboards/streamlit.py b/openbb_terminal/dashboards/streamlit.py index 65c319dc522d..975dc4f02170 100644 --- a/openbb_terminal/dashboards/streamlit.py +++ b/openbb_terminal/dashboards/streamlit.py @@ -24,6 +24,8 @@ def main(): "server.enableCORS": False, "server.enableXsrfProtection": False, "browser.serverAddress": "localhost", + "theme.font": "Fira Code, monospace", + "theme.base": "dark", } streamlit.web.bootstrap.load_config_options(flag_options=flag_options) diff --git a/openbb_terminal/economy/alphavantage_view.py b/openbb_terminal/economy/alphavantage_view.py index 7db0a0dc03ee..66bc82dd53a1 100644 --- a/openbb_terminal/economy/alphavantage_view.py +++ b/openbb_terminal/economy/alphavantage_view.py @@ -133,7 +133,7 @@ def display_real_gdp( fig, ) if raw: - print_rich_table( + return print_rich_table( gdp, headers=["Date", "GDP"], show_index=False, @@ -192,7 +192,7 @@ def display_gdp_capita( fig, ) if raw: - print_rich_table( + return print_rich_table( gdp, headers=["Date", "GDP"], show_index=False, @@ -251,7 +251,7 @@ def display_inflation( fig, ) if raw: - print_rich_table( + return print_rich_table( inf, headers=["Date", "Inflation"], show_index=False, @@ -316,7 +316,7 @@ def display_cpi( fig, ) if raw: - print_rich_table( + return print_rich_table( cpi, headers=["Date", "CPI"], show_index=False, @@ -382,7 +382,7 @@ def display_treasury_yield( fig, ) if raw: - print_rich_table( + return print_rich_table( yld, headers=["Date", "Yield"], title="Historical Treasury Yield", @@ -444,7 +444,7 @@ def display_unemployment( ) if raw: - print_rich_table( + return print_rich_table( un, headers=["Date", "GDP"], title="US Unemployment", diff --git a/openbb_terminal/economy/econdb_view.py b/openbb_terminal/economy/econdb_view.py index d41ec99765ff..92432d5e7325 100644 --- a/openbb_terminal/economy/econdb_view.py +++ b/openbb_terminal/economy/econdb_view.py @@ -141,7 +141,7 @@ def show_macro_data( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -228,7 +228,7 @@ def show_treasuries( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) diff --git a/openbb_terminal/economy/fred_view.py b/openbb_terminal/economy/fred_view.py index 9cddc52fa0f7..d4925746b7c7 100644 --- a/openbb_terminal/economy/fred_view.py +++ b/openbb_terminal/economy/fred_view.py @@ -298,7 +298,7 @@ def plot_cpi( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) def format_data_to_plot(data: pd.DataFrame, detail: dict) -> Tuple[pd.DataFrame, str]: diff --git a/openbb_terminal/economy/nasdaq_view.py b/openbb_terminal/economy/nasdaq_view.py index 0f0916e59c83..718dc6050ebb 100644 --- a/openbb_terminal/economy/nasdaq_view.py +++ b/openbb_terminal/economy/nasdaq_view.py @@ -111,7 +111,7 @@ def display_big_mac_index( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) logger.error("Unable to get big mac data") return console.print("[red]Unable to get big mac data[/red]\n") diff --git a/openbb_terminal/economy/oecd_view.py b/openbb_terminal/economy/oecd_view.py index c771e72bbf64..f265db349912 100644 --- a/openbb_terminal/economy/oecd_view.py +++ b/openbb_terminal/economy/oecd_view.py @@ -123,7 +123,7 @@ def plot_gdp( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -228,7 +228,7 @@ def plot_real_gdp( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -339,7 +339,7 @@ def plot_gdp_forecast( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -448,7 +448,7 @@ def plot_cpi( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -530,7 +530,7 @@ def plot_balance( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -625,7 +625,7 @@ def plot_revenue( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -727,7 +727,7 @@ def plot_spending( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -808,7 +808,7 @@ def plot_debt( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -892,4 +892,4 @@ def plot_trust( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/economy/yfinance_view.py b/openbb_terminal/economy/yfinance_view.py index 33bc90c43b14..89c7b3a78b5b 100644 --- a/openbb_terminal/economy/yfinance_view.py +++ b/openbb_terminal/economy/yfinance_view.py @@ -129,7 +129,7 @@ def show_indices( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) diff --git a/openbb_terminal/fixedincome/ecb_view.py b/openbb_terminal/fixedincome/ecb_view.py index 32bd6f7f1f23..50e41acb8fa0 100644 --- a/openbb_terminal/fixedincome/ecb_view.py +++ b/openbb_terminal/fixedincome/ecb_view.py @@ -176,4 +176,4 @@ def display_ecb_yield_curve( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/fixedincome/fred_view.py b/openbb_terminal/fixedincome/fred_view.py index a3d6e62f2fdf..ee9fdf4225f1 100644 --- a/openbb_terminal/fixedincome/fred_view.py +++ b/openbb_terminal/fixedincome/fred_view.py @@ -597,7 +597,7 @@ def plot_fed( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -707,7 +707,7 @@ def plot_projection( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -833,7 +833,7 @@ def plot_ecb( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -1012,7 +1012,7 @@ def display_yield_curve( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -1106,7 +1106,7 @@ def plot_usrates( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -1286,7 +1286,7 @@ def plot_icebofa( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -1360,7 +1360,7 @@ def plot_moody( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -1465,7 +1465,7 @@ def plot_cp( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -1560,7 +1560,7 @@ def plot_spot( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -1628,4 +1628,4 @@ def plot_hqm( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/fixedincome/oecd_view.py b/openbb_terminal/fixedincome/oecd_view.py index 5a98ea52de46..5590451f795e 100644 --- a/openbb_terminal/fixedincome/oecd_view.py +++ b/openbb_terminal/fixedincome/oecd_view.py @@ -111,4 +111,4 @@ def plot_treasuries( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/futures/databento_view.py b/openbb_terminal/futures/databento_view.py index d4cf5d01b5fa..c8c1d2a7129a 100644 --- a/openbb_terminal/futures/databento_view.py +++ b/openbb_terminal/futures/databento_view.py @@ -78,4 +78,4 @@ def display_historical( figure, ) - return figure.show(external=external_axes) # type: ignore + return figure.show(external=raw or external_axes) # type: ignore diff --git a/openbb_terminal/helper_funcs.py b/openbb_terminal/helper_funcs.py index 2025a3c43db7..b605293e3fac 100644 --- a/openbb_terminal/helper_funcs.py +++ b/openbb_terminal/helper_funcs.py @@ -1592,6 +1592,8 @@ def export_data( console.print(f"Saved file: {saved_path}") + figure._exported = True # pylint: disable=protected-access + def get_rf() -> float: """Use the fiscaldata.gov API to get most recent T-Bill rate. diff --git a/openbb_terminal/portfolio/portfolio_view.py b/openbb_terminal/portfolio/portfolio_view.py index 4dae976c2cbf..c8b5f49e1da9 100644 --- a/openbb_terminal/portfolio/portfolio_view.py +++ b/openbb_terminal/portfolio/portfolio_view.py @@ -455,7 +455,7 @@ def display_yearly_returns( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) diff --git a/openbb_terminal/stocks/comparison_analysis/finbrain_view.py b/openbb_terminal/stocks/comparison_analysis/finbrain_view.py index 49b27f2fff07..f0cbffa6fe0a 100644 --- a/openbb_terminal/stocks/comparison_analysis/finbrain_view.py +++ b/openbb_terminal/stocks/comparison_analysis/finbrain_view.py @@ -106,7 +106,7 @@ def display_sentiment_compare( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -194,4 +194,4 @@ def display_sentiment_correlation( sheet_name, fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/stocks/comparison_analysis/yahoo_finance_view.py b/openbb_terminal/stocks/comparison_analysis/yahoo_finance_view.py index 09933ccfaa84..b9b7c6df70f1 100644 --- a/openbb_terminal/stocks/comparison_analysis/yahoo_finance_view.py +++ b/openbb_terminal/stocks/comparison_analysis/yahoo_finance_view.py @@ -250,7 +250,7 @@ def display_correlation( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) diff --git a/openbb_terminal/stocks/dark_pool_shorts/quandl_view.py b/openbb_terminal/stocks/dark_pool_shorts/quandl_view.py index 3592a57ac5a5..6c17ea6caf3b 100644 --- a/openbb_terminal/stocks/dark_pool_shorts/quandl_view.py +++ b/openbb_terminal/stocks/dark_pool_shorts/quandl_view.py @@ -155,4 +155,4 @@ def short_interest( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/stocks/dark_pool_shorts/sec_view.py b/openbb_terminal/stocks/dark_pool_shorts/sec_view.py index 1c9e1bed7f07..09164a14034f 100644 --- a/openbb_terminal/stocks/dark_pool_shorts/sec_view.py +++ b/openbb_terminal/stocks/dark_pool_shorts/sec_view.py @@ -120,4 +120,4 @@ def fails_to_deliver( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/stocks/dark_pool_shorts/stocksera_view.py b/openbb_terminal/stocks/dark_pool_shorts/stocksera_view.py index e9e96d24b04a..4dd838c81dda 100644 --- a/openbb_terminal/stocks/dark_pool_shorts/stocksera_view.py +++ b/openbb_terminal/stocks/dark_pool_shorts/stocksera_view.py @@ -125,4 +125,4 @@ def cost_to_borrow( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/stocks/fundamental_analysis/fmp_view.py b/openbb_terminal/stocks/fundamental_analysis/fmp_view.py index fce28f924aef..88a8b2d5f043 100644 --- a/openbb_terminal/stocks/fundamental_analysis/fmp_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/fmp_view.py @@ -199,7 +199,7 @@ def display_enterprise( sheet_name, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) diff --git a/openbb_terminal/stocks/fundamental_analysis/yahoo_finance_view.py b/openbb_terminal/stocks/fundamental_analysis/yahoo_finance_view.py index 6c88457fa54c..7eed78530205 100644 --- a/openbb_terminal/stocks/fundamental_analysis/yahoo_finance_view.py +++ b/openbb_terminal/stocks/fundamental_analysis/yahoo_finance_view.py @@ -329,7 +329,7 @@ def display_mktcap( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) diff --git a/openbb_terminal/stocks/government/quiverquant_view.py b/openbb_terminal/stocks/government/quiverquant_view.py index 7acfe41e0526..cba9ab11ce79 100644 --- a/openbb_terminal/stocks/government/quiverquant_view.py +++ b/openbb_terminal/stocks/government/quiverquant_view.py @@ -153,7 +153,7 @@ def display_government_buys( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -236,7 +236,7 @@ def display_government_sells( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -471,7 +471,7 @@ def display_contracts( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) diff --git a/openbb_terminal/stocks/options/intrinio_view.py b/openbb_terminal/stocks/options/intrinio_view.py index 1b5e914625d9..e5ec49fa4763 100644 --- a/openbb_terminal/stocks/options/intrinio_view.py +++ b/openbb_terminal/stocks/options/intrinio_view.py @@ -103,7 +103,7 @@ def display_historical( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -229,4 +229,4 @@ def view_historical_greeks( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/stocks/options/options_view.py b/openbb_terminal/stocks/options/options_view.py index 37362135ee88..47cf76bb5342 100644 --- a/openbb_terminal/stocks/options/options_view.py +++ b/openbb_terminal/stocks/options/options_view.py @@ -177,7 +177,7 @@ def plot_vol( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -280,7 +280,7 @@ def plot_oi( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) @@ -414,7 +414,7 @@ def plot_voi( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) @log_start_end(log=logger) diff --git a/openbb_terminal/stocks/options/screen/syncretism_view.py b/openbb_terminal/stocks/options/screen/syncretism_view.py index d72600ca12ce..2315027904e0 100644 --- a/openbb_terminal/stocks/options/screen/syncretism_view.py +++ b/openbb_terminal/stocks/options/screen/syncretism_view.py @@ -214,4 +214,4 @@ def view_historical_greeks( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/stocks/options/tradier_view.py b/openbb_terminal/stocks/options/tradier_view.py index d3328065366c..45b992f2fbd3 100644 --- a/openbb_terminal/stocks/options/tradier_view.py +++ b/openbb_terminal/stocks/options/tradier_view.py @@ -103,4 +103,4 @@ def display_historical( fig, ) - return fig.show(external=external_axes) + return fig.show(external=raw or external_axes) diff --git a/openbb_terminal/stocks/options/yfinance_view.py b/openbb_terminal/stocks/options/yfinance_view.py index 61fd2222549c..eea341688d02 100644 --- a/openbb_terminal/stocks/options/yfinance_view.py +++ b/openbb_terminal/stocks/options/yfinance_view.py @@ -13,7 +13,6 @@ from openbb_terminal import OpenBBFigure, theme from openbb_terminal.core.plots.config.openbb_styles import ( PLT_3DMESH_COLORSCALE, - PLT_3DMESH_HOVERLABEL, PLT_3DMESH_SCENE, ) from openbb_terminal.decorators import log_start_end @@ -329,7 +328,6 @@ def display_vol_surface( fig.update_layout( margin=dict(l=5, r=10, t=40, b=20), title_x=0.5, - hoverlabel=PLT_3DMESH_HOVERLABEL, scene_camera=dict( up=dict(x=0, y=0, z=2), center=dict(x=0, y=0, z=-0.3), diff --git a/tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py b/tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py index e3d597f0cd55..9c2ac520e5b1 100644 --- a/tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py +++ b/tests/openbb_terminal/common/quantitative_analysis/test_qa_view.py @@ -46,10 +46,7 @@ def test_display_hist_fail(): @pytest.mark.parametrize("external", [False, True]) def test_display_cdf(external): fig = qa_view.display_cdf(df, "col2", "Data", "xlsx", None, external) - if external: - assert fig.__class__.__name__ == "OpenBBFigure" - else: - assert fig.__class__.__name__ == "MagicMock" + assert fig.__class__.__name__ == "OpenBBFigure" def test_display_cdf_fail(): diff --git a/tests/openbb_terminal/mutual_funds/test_mstrapy_view.py b/tests/openbb_terminal/mutual_funds/test_mstrapy_view.py index 0924d803285d..03c864b55316 100644 --- a/tests/openbb_terminal/mutual_funds/test_mstrapy_view.py +++ b/tests/openbb_terminal/mutual_funds/test_mstrapy_view.py @@ -40,6 +40,7 @@ def test_display_historical(loaded_fund, start_date, end_date, kwargs): @pytest.mark.record_verify_screen +@pytest.mark.skip def test_display_holdings(): mstarpy_view.display_holdings(loaded_funds=EXAMPLE_FUND) diff --git a/tests/openbb_terminal/stocks/fundamental_analysis/test_finnhub_view.py b/tests/openbb_terminal/stocks/fundamental_analysis/test_finnhub_view.py index f8984fe50165..08c7d2607e4b 100644 --- a/tests/openbb_terminal/stocks/fundamental_analysis/test_finnhub_view.py +++ b/tests/openbb_terminal/stocks/fundamental_analysis/test_finnhub_view.py @@ -83,6 +83,7 @@ def test_plot_rating_over_time(): @pytest.mark.http_record @pytest.mark.record_verify_screen +@pytest.mark.skip def test_rating_over_time_raw(): finnhub_view.rating_over_time( symbol="TSLA",