From e667125ef44314b511e35bd57e54a5a315d6f478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Fredrik=20Ki=C3=A6r?= <31612826+anders-kiaer@users.noreply.github.com> Date: Tue, 17 Oct 2023 07:19:29 +0000 Subject: [PATCH] Change time series module previews --- .../modules/SimulationTimeSeries/preview.svg | 6 +++ .../modules/SimulationTimeSeries/preview.tsx | 33 +------------ .../SimulationTimeSeriesMatrix/preview.svg | 9 ++++ .../SimulationTimeSeriesMatrix/preview.tsx | 46 +------------------ 4 files changed, 19 insertions(+), 75 deletions(-) create mode 100644 frontend/src/modules/SimulationTimeSeries/preview.svg create mode 100644 frontend/src/modules/SimulationTimeSeriesMatrix/preview.svg diff --git a/frontend/src/modules/SimulationTimeSeries/preview.svg b/frontend/src/modules/SimulationTimeSeries/preview.svg new file mode 100644 index 000000000..5a78c8a3e --- /dev/null +++ b/frontend/src/modules/SimulationTimeSeries/preview.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/frontend/src/modules/SimulationTimeSeries/preview.tsx b/frontend/src/modules/SimulationTimeSeries/preview.tsx index 51231bf8b..eb2960245 100644 --- a/frontend/src/modules/SimulationTimeSeries/preview.tsx +++ b/frontend/src/modules/SimulationTimeSeries/preview.tsx @@ -1,35 +1,6 @@ import { DrawPreviewFunc } from "@framework/Preview"; +import previewImg from "./preview.svg"; export const preview: DrawPreviewFunc = function (width: number, height: number) { - const paths: { x1: number; y1: number; x2: number; y2: number; x3: number; y3: number; xc: number; yc: number }[] = - []; - const numPaths = 10; - for (let i = 0; i < numPaths; i++) { - const x1 = 0; - const y1 = height - (i / numPaths) * height; - const x2 = width / 2; - const y2 = height - ((i - 1) / numPaths) * height; - const x3 = width; - const y3 = height - (((i - 1) / numPaths) * height) / 1.2; - const xc = width / 4; - const yc = height - (i / numPaths) * height - height / 12; - paths.push({ x1, y1, x2, y2, x3, y3, xc, yc }); - } - return ( - - - - {paths.map((path, index) => { - return ( - - ); - })} - - ); + return }; diff --git a/frontend/src/modules/SimulationTimeSeriesMatrix/preview.svg b/frontend/src/modules/SimulationTimeSeriesMatrix/preview.svg new file mode 100644 index 000000000..f87d9840c --- /dev/null +++ b/frontend/src/modules/SimulationTimeSeriesMatrix/preview.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/frontend/src/modules/SimulationTimeSeriesMatrix/preview.tsx b/frontend/src/modules/SimulationTimeSeriesMatrix/preview.tsx index d61301c73..eb2960245 100644 --- a/frontend/src/modules/SimulationTimeSeriesMatrix/preview.tsx +++ b/frontend/src/modules/SimulationTimeSeriesMatrix/preview.tsx @@ -1,48 +1,6 @@ import { DrawPreviewFunc } from "@framework/Preview"; +import previewImg from "./preview.svg"; export const preview: DrawPreviewFunc = function (width: number, height: number) { - const paths: { - x1: number; - y1: number; - x2: number; - y2: number; - x3: number; - y3: number; - xc: number; - yc: number; - color: string; - }[] = []; - const numPaths = 9; - for (let i = 0; i < numPaths; i++) { - const x1 = 0; - const y1 = height - (i / numPaths) * height; - const x2 = width / 2; - const y2 = height - ((i - 1) / numPaths) * height; - const x3 = width; - const y3 = height - (((i - 1) / numPaths) * height) / 1.2; - const xc = width / 4; - const yc = height - (i / numPaths) * height - height / 12; - - // Assign colors based on position - const color = i < 3 ? "green" : i < 6 ? "red" : "blue"; - - paths.push({ x1, y1, x2, y2, x3, y3, xc, yc, color }); - } - return ( - - - - {paths.map((path, index) => { - return ( - - ); - })} - - ); + return };