mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-31 22:41:19 +00:00
Update plotly_helper.py
This commit is contained in:
@@ -78,6 +78,12 @@ class TerminalStyle:
|
||||
|
||||
line_width: float = 1.5
|
||||
|
||||
def __new__(cls, *args, **kwargs): # pylint: disable=W0613
|
||||
"""Create a singleton."""
|
||||
if not hasattr(cls, "instance"):
|
||||
cls.instance = super().__new__(cls) # pylint: disable=E1120
|
||||
return cls.instance
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
plt_style: Optional[str] = "",
|
||||
@@ -247,8 +253,9 @@ class TerminalStyle:
|
||||
list
|
||||
List of colors e.g. ["#00ACFF", "#FF0000"]
|
||||
"""
|
||||
self.apply_style()
|
||||
colors = self.plotly_template.get("layout", {}).get("colorway", PLT_COLORWAY)
|
||||
colors = (
|
||||
self.plotly_template.get("layout", {}).get("colorway", PLT_COLORWAY).copy()
|
||||
)
|
||||
if reverse:
|
||||
colors.reverse()
|
||||
return colors
|
||||
|
||||
Reference in New Issue
Block a user