From 9028bf0a30d65a873387ebb44e3f9b80e98f629a Mon Sep 17 00:00:00 2001 From: teh_coderer Date: Wed, 3 May 2023 11:08:16 -0400 Subject: [PATCH] update --- frontend-components/plotly/src/App.tsx | 2 +- .../plotly/src/components/Chart.tsx | 8 +- .../components/Dialogs/TextChartDialog.tsx | 91 +++++----- openbb_terminal/core/plots/plotly.html | 164 +++++++++--------- 4 files changed, 133 insertions(+), 132 deletions(-) diff --git a/frontend-components/plotly/src/App.tsx b/frontend-components/plotly/src/App.tsx index ef380ed627d..ff40c0ad9ba 100644 --- a/frontend-components/plotly/src/App.tsx +++ b/frontend-components/plotly/src/App.tsx @@ -144,7 +144,7 @@ function App() { date={transformedData.date} cmd={transformedData.cmd} title={transformedData.title} - global={transformedData.globals} + globals={transformedData.globals} info={info} /> ); diff --git a/frontend-components/plotly/src/components/Chart.tsx b/frontend-components/plotly/src/components/Chart.tsx index f52acff397c..d8c59e1b4b6 100644 --- a/frontend-components/plotly/src/components/Chart.tsx +++ b/frontend-components/plotly/src/components/Chart.tsx @@ -23,7 +23,7 @@ export default function Chart({ date, cmd, title, - global, + globals, info, }: { // @ts-ignore @@ -31,21 +31,19 @@ export default function Chart({ date: Date; cmd: string; title: string; - global: any; + globals: any; info?: any; }) { const posthog = usePostHog(); useEffect(() => { if (posthog) posthog.capture("chart", info); - }, [info]); + }, []); delete json.layout.width; delete json.layout.height; json.layout.title.text = ""; - const [globals, setGlobals] = useState(global); - const [barButtons, setModeBarButtons] = useState({}); const [LogYaxis, setLogYaxis] = useState(false); const [chartTitle, setChartTitle] = useState(title); diff --git a/frontend-components/plotly/src/components/Dialogs/TextChartDialog.tsx b/frontend-components/plotly/src/components/Dialogs/TextChartDialog.tsx index d6c0f5afb63..f5ee1b0c994 100644 --- a/frontend-components/plotly/src/components/Dialogs/TextChartDialog.tsx +++ b/frontend-components/plotly/src/components/Dialogs/TextChartDialog.tsx @@ -112,55 +112,58 @@ export default function TextChartDialog({ defaultValue={popUpData?.annotation?.text || newPopupData?.text} > -
-
- - -
-
- - -
-
+
+ }} + > + + + + + + +
- - -
-
-