From f533a1ffcb9132e7421ea2e8c3b4453d03c0d96e Mon Sep 17 00:00:00 2001 From: VentelR Date: Sat, 13 Apr 2024 17:00:11 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=BA=D0=B8=D1=80=D0=BF=D0=B8=D1=87=20?= =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tgui/interfaces/AtmosGraphMonitor.tsx | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/tgui/packages/tgui/interfaces/AtmosGraphMonitor.tsx b/tgui/packages/tgui/interfaces/AtmosGraphMonitor.tsx index cb8f1eb39b3f..8af05b7529ef 100644 --- a/tgui/packages/tgui/interfaces/AtmosGraphMonitor.tsx +++ b/tgui/packages/tgui/interfaces/AtmosGraphMonitor.tsx @@ -43,12 +43,25 @@ export const AtmosGraphMonitor = (props, context) => { return "WE SHOULDN'T BE HERE!"; } }; - const getWindowHeight = Math.min( - 800, - Object.keys(data.sensors).length * 220 + 150 - ); + const getWindowHeight = (sensorsLenght: number) => { + switch (sensorsLenght) { + case 0: + return 180; + case 1: + return 350; + case 2: + return 590; + case 3: + return 830; + default: + return 870; + } + }; return ( - + @@ -129,7 +142,10 @@ const AtmosGraphPage = ({ 0, getDataToSensor(s, temperatureListName).length - 1, ]} - rangeY={[0, getMaxReading(s, temperatureListName) + 5]} + rangeY={[ + getMinReading(s, temperatureListName) - 10, + getMaxReading(s, temperatureListName) + 5, + ]} strokeColor="rgba(219, 40, 40, 1)" fillColor="rgba(219, 40, 40, 0.1)" /> @@ -158,7 +174,10 @@ const AtmosGraphPage = ({ 0, getDataToSensor(s, pressureListName).length - 1, ]} - rangeY={[0, getMaxReading(s, pressureListName) + 5]} + rangeY={[ + getMinReading(s, pressureListName) - 10, + getMaxReading(s, pressureListName) + 5, + ]} strokeColor="rgba(40, 219, 40, 1)" fillColor="rgba(40, 219, 40, 0.1)" />