From 0cfd20852712467c95adb7915603a8afaaedc6ff Mon Sep 17 00:00:00 2001 From: teh_coderer Date: Mon, 1 May 2023 11:16:35 -0400 Subject: [PATCH] add shortcuts --- .../plotly/src/components/PlotlyConfig.tsx | 23 ++++++++ openbb_terminal/core/plots/plotly.html | 52 +++++++++---------- 2 files changed, 49 insertions(+), 26 deletions(-) diff --git a/frontend-components/plotly/src/components/PlotlyConfig.tsx b/frontend-components/plotly/src/components/PlotlyConfig.tsx index ec9e4c27a3c..7ff1d17cfa9 100644 --- a/frontend-components/plotly/src/components/PlotlyConfig.tsx +++ b/frontend-components/plotly/src/components/PlotlyConfig.tsx @@ -65,6 +65,29 @@ export function PlotConfig({ }, { preventDefault: true } ); + useHotkeys( + "ctrl+e", + () => { + changeColor(true); + }, + { preventDefault: true } + ); + useHotkeys( + "ctrl+shift+s", + async () => { + setModal({ modal: "downloadCsv" }); + await downloadCSV(document.getElementById("plotlyChart") as any); + }, + { preventDefault: true } + ); + useHotkeys( + "ctrl+s", + async () => { + hideModebar(); + downloadImage("MainChart", hideModebar, Loading); + }, + { preventDefault: true } + ); useHotkeys( "ctrl+w", () => { diff --git a/openbb_terminal/core/plots/plotly.html b/openbb_terminal/core/plots/plotly.html index c06a9e1ee55..a30b7a75b25 100644 --- a/openbb_terminal/core/plots/plotly.html +++ b/openbb_terminal/core/plots/plotly.html @@ -33,52 +33,52 @@ }