Skip to content

Commit

Permalink
fix: кирпич убран
Browse files Browse the repository at this point in the history
  • Loading branch information
VentelR committed Apr 13, 2024
1 parent 07be4e6 commit f533a1f
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions tgui/packages/tgui/interfaces/AtmosGraphMonitor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Window width={700} height={getWindowHeight}>
<Window
width={700}
height={getWindowHeight(Object.keys(data.sensors).length)}
>
<Window.Content scrollable>
<Box fillPositionedParent>
<Tabs>
Expand Down Expand Up @@ -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)"
/>
Expand Down Expand Up @@ -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)"
/>
Expand Down

0 comments on commit f533a1f

Please sign in to comment.