Skip to content
Closed
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
12 changes: 7 additions & 5 deletions frontend/src/renderer/components/grid/HoverButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
IconTrash,
IconTarget,
} from '@tabler/icons-react';
import { useHover } from '@mantine/hooks';
import { useElementSize, useHover, useMergedRef } from '@mantine/hooks';
import {
Configuration,
CustomizedGridType,
Expand Down Expand Up @@ -55,6 +55,8 @@ export const HoverButtons = React.memo(
}: HoverButtonsProps) => {
const { active, updatedConfiguration } = useIbexStore();
const { hovered, ref: hoverRef } = useHover();
const { ref: sizeRef, width: containerWidth } = useElementSize();
const containerRef = useMergedRef(hoverRef, sizeRef);
const previousValueDisplayErrorBands = useRef<boolean | undefined>(
undefined,
);
Expand Down Expand Up @@ -196,7 +198,7 @@ export const HoverButtons = React.memo(
};

return (
<div ref={hoverRef} className={classes.containerButton}>
<div ref={containerRef} className={classes.containerButton}>
<Group justify="space-between" h={'100%'}>
{is3DView || !data.coordinates.length || shouldDisplayMetadata ? (
<Tabs
Expand All @@ -209,10 +211,10 @@ export const HoverButtons = React.memo(
scrollbarSize={6}
offsetScrollbars
maw={
hoverRef?.current?.offsetWidth
containerWidth
? !data.coordinates.length || shouldDisplayMetadata
? hoverRef.current.offsetWidth - 110
: hoverRef.current.offsetWidth - 230
? containerWidth - 110
: containerWidth - 280
: '100%'
}
>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/renderer/layout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ export function MainLayout() {
line: plot?.line || {},
customPreferences: plot?.customPreferences || {},
mode: plot?.mode || 'line',
smoothing: plot?.smoothing,
operations: plot?.operations,
};
}),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import {
CustomizeDataRange,
CustomizeSynchronization,
CustomizeInterpolation,
CustomizeSmoothing,
CustomizeUnaryOperations,
CustomizeGeometry,
} from './customizableElements';
import { IconGeometry, IconLink } from '@tabler/icons-react';
Expand Down Expand Up @@ -481,6 +483,26 @@ const Customization = ({
/>
),
},
{
value: 'Data smoothing',
component: (
<CustomizeSmoothing
customizedDataGrid={customizedDataGrid}
selectedPlot={selectedPlot}
setCustomizedDataGrid={setCustomizedDataGrid}
/>
),
},
{
value: 'Unary operations',
component: (
<CustomizeUnaryOperations
customizedDataGrid={customizedDataGrid}
selectedPlot={selectedPlot}
setCustomizedDataGrid={setCustomizedDataGrid}
/>
),
},
];

const items = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
getUrisToInterpolate,
getVectorData,
normalizeIndices,
reapplyAxisOrder,
} from '../../../utils';
import { showNotification } from '@mantine/notifications';
import { Button, Group, NumberInput, Select, Stack } from '@mantine/core';
Expand Down Expand Up @@ -118,6 +119,13 @@ export const CustomizeDownsampling = ({
plotIndex++;
}

// Re-apply axis transposition: the back-end returns data in default axis
// order, so restore the user's transposition after the fetch
const wantedAxeIndexOrder = customizedDataGrid.coordinates.map(
(coord) => coord.axeIndex,
);
await reapplyAxisOrder(updatedDataPlot, wantedAxeIndexOrder);

// Save new configuration with downsampled data
setCustomizedDataGrid({
...customizedDataGrid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
normalizeIndices,
getInterpolationMethods,
getUrisToInterpolate,
reapplyAxisOrder,
} from '../../../utils';
import { showNotification } from '@mantine/notifications';
import { Group, Loader, Select, Stack } from '@mantine/core';
Expand Down Expand Up @@ -118,6 +119,13 @@ export const CustomizeInterpolation = ({
plotIndex++;
}

// Re-apply axis transposition: the back-end returns data in default axis
// order, so restore the user's transposition after the fetch
const wantedAxeIndexOrder = customizedDataGrid.coordinates.map(
(coord) => coord.axeIndex,
);
await reapplyAxisOrder(updatedDataPlot, wantedAxeIndexOrder);

// Save new configuration with interpolated data
setCustomizedDataGrid({
...customizedDataGrid,
Expand Down
Loading
Loading