Skip to content

Commit

Permalink
Started adjusting visualization layer
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Nov 28, 2023
1 parent df5db8c commit fdbb336
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ export const DataChannelVisualizationLayer: React.FC<DataChannelVisualizationPro
y: midPointY,
};

if (Math.abs(originPoint.y - currentPointerPosition.y) < 40) {
midPoint1.y = originPoint.y - Math.sign(originPoint.y - currentPointerPosition.y) * 80;
midPoint2.y = currentPointerPosition.y - Math.sign(originPoint.y - currentPointerPosition.y) * 80;
}

function makeDataChannelPaths() {
const dataChannelPaths: DataChannelPath[] = [];
for (const moduleInstance of props.workbench.getModuleInstances()) {
Expand Down Expand Up @@ -305,6 +310,11 @@ export const DataChannelVisualizationLayer: React.FC<DataChannelVisualizationPro
y: (originPoint.y + destinationPoint.y) / 2,
};

if (Math.abs(originPoint.y - destinationPoint.y) < 40) {
midPoint1.y = originPoint.y - Math.sign(originPoint.y - destinationPoint.y) * 80;
midPoint2.y = destinationPoint.y - Math.sign(originPoint.y - destinationPoint.y) * 80;
}

const descriptionCenterPoint: Point = {
x: (originPoint.x + destinationPoint.x) / 2,
y: (originPoint.y + destinationPoint.y) / 2,
Expand Down
19 changes: 0 additions & 19 deletions frontend/src/modules/InplaceVolumetricsNew/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,12 @@ import { Channels } from "./channelDefs";
import { useRealizationsResponses } from "./hooks/useRealizationResponses";
import { State } from "./state";

function heavyOperation() {
const promise = new Promise<string>((resolve) => {
setTimeout(() => resolve("done!"), 1000);
});
return promise;
}

export const view = (props: ModuleFCProps<State>) => {
const responseNames = props.moduleContext.useStoreValue("selectedResponseNames");
const tableNames = props.moduleContext.useStoreValue("selectedTableNames");
const ensembleIdents = props.moduleContext.useStoreValue("selectedEnsembleIdents");
const categoricalMetadata = props.moduleContext.useStoreValue("selectedCategoricalMetadata");
const ref = React.useRef<HTMLDivElement>(null);
const [test, setTest] = React.useState<string>("");

async function asyncFunc() {
const result = await heavyOperation();
setTest(result);
}

function callAsyncFunc() {
asyncFunc();
}

asyncFunc();

const statusWriter = useViewStatusWriter(props.moduleContext);

Expand Down

0 comments on commit fdbb336

Please sign in to comment.