Skip to content

Fix vertical scroll on horizontal layout #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions frontend-v2/src/features/model/MapVariablesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,7 @@ const MapVariablesTab: FC<Props> = ({
</Table>
</TableContainer>
<Box sx={{ marginTop: ".5rem" }}>
<TableHeader
variant="h5"
label="Map RO, PD and secondary parameters"
/>
<TableHeader variant="h5" label="Map RO, PD and secondary parameters" />
</Box>
<TableContainer
sx={{
Expand Down
3 changes: 3 additions & 0 deletions frontend-v2/src/features/model/ParameterRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const ParameterRow: FC<Props> = ({ project, variable, units }) => {
</TableCell>
<TableCell size="small" sx={{ width: "10rem" }}>
<FloatField
sx={{ minWidth: "5rem" }}
size="small"
name="lower_bound"
control={control}
Expand All @@ -98,6 +99,7 @@ const ParameterRow: FC<Props> = ({ project, variable, units }) => {
</TableCell>
<TableCell size="small" sx={{ width: "10rem" }}>
<FloatField
sx={{ minWidth: "5rem" }}
size="small"
name="default_value"
control={control}
Expand All @@ -109,6 +111,7 @@ const ParameterRow: FC<Props> = ({ project, variable, units }) => {
</TableCell>
<TableCell size="small" sx={{ width: "10rem" }}>
<FloatField
sx={{ minWidth: "5rem" }}
size="small"
name="upper_bound"
control={control}
Expand Down
2 changes: 2 additions & 0 deletions frontend-v2/src/features/model/secondary/ThresholdsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function VariableRow({
</TableCell>
<TableCell sx={{ width: "20rem" }}>
<TextField
sx={{ minWidth: "5rem" }}
type="number"
defaultValue={variable.lower_threshold || 0}
onChange={onChangeLowerThreshold}
Expand All @@ -161,6 +162,7 @@ function VariableRow({
</TableCell>
<TableCell sx={{ width: "20rem" }}>
<TextField
sx={{ minWidth: "5rem" }}
type="number"
defaultValue={variable.upper_threshold || Infinity}
onChange={onChangeUpperThreshold}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ import {
} from "../../../app/backendApi";
import { RootState } from "../../../app/store";
import { useModelTimeIntervals } from "../../../hooks/useModelTimeIntervals";
import {
getTableHeight,
} from "../../../shared/calculateTableHeights";
import { getTableHeight } from "../../../shared/calculateTableHeights";

const TABLE_BREAKPOINTS = [
{
Expand Down Expand Up @@ -148,6 +146,7 @@ function IntervalRow({
<TableRow>
<TableCell sx={{ width: "20rem" }}>
<TextField
sx={{ minWidth: "5rem" }}
size="small"
type="number"
value={start}
Expand All @@ -158,6 +157,7 @@ function IntervalRow({
</TableCell>
<TableCell sx={{ width: "20rem" }}>
<TextField
sx={{ minWidth: "5rem" }}
size="small"
type="number"
value={end}
Expand Down
12 changes: 6 additions & 6 deletions frontend-v2/src/features/simulation/SimulationPlotView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,34 +480,34 @@ const SimulationPlotView: FC<SimulationPlotProps> = ({
if (isVertical && !isHorizontal) {
return dimensions.width > layoutBreakpoint
? {
height: dimensions.height / 2 ,
height: dimensions.height / 2 - buffor,
width: dimensions.width - buffor,
}
: {
height: dimensions.height / 1.5,
height: dimensions.height / 1.5 - buffor,
width: dimensions.width - buffor,
};
}

if (!isVertical && isHorizontal) {
return dimensions.width > layoutBreakpoint
? {
height: dimensions.height,
height: dimensions.height - buffor,
width: dimensions.width / columnCount - buffor,
}
: {
height: dimensions.height,
height: dimensions.height - buffor,
width: dimensions.width / 1.5 - buffor,
};
}

return dimensions.width > layoutBreakpoint
? {
height: dimensions.height / 2,
height: dimensions.height / 2 - buffor,
width: dimensions.width / columnCount - buffor,
}
: {
height: dimensions.height / 2,
height: dimensions.height / 2 - buffor,
width: dimensions.width / columnCount - buffor,
};
};
Expand Down
Loading