Skip to content

Commit

Permalink
Add more module previews (equinor#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Oct 3, 2023
1 parent e50e4b9 commit bb83fa9
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 4 deletions.
8 changes: 8 additions & 0 deletions frontend/src/modules/Grid3D/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { DrawPreviewFunc } from "@framework/Preview";
import previewImg from "./preview.webp";

export const preview: DrawPreviewFunc = function (width: number, height: number) {
return (
<img src={previewImg} style={{width, height}} className="object-cover object-center" />
);
};
Binary file added frontend/src/modules/Grid3D/preview.webp
Binary file not shown.
3 changes: 2 additions & 1 deletion frontend/src/modules/Grid3D/registerModule.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ModuleRegistry } from "@framework/ModuleRegistry";

import { preview } from "./preview";
import state from "./state";

ModuleRegistry.registerModule<state>({ moduleName: "Grid3D", defaultTitle: "3D grid" });
ModuleRegistry.registerModule<state>({ moduleName: "Grid3D", defaultTitle: "3D grid", preview });
104 changes: 104 additions & 0 deletions frontend/src/modules/Grid3DIntersection/preview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions frontend/src/modules/Grid3DIntersection/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { DrawPreviewFunc } from "@framework/Preview";
import previewImg from "./preview.svg";

export const preview: DrawPreviewFunc = function (width: number, height: number) {
return <img src={previewImg} style={{width, height}} />
};
3 changes: 2 additions & 1 deletion frontend/src/modules/Grid3DIntersection/registerModule.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ModuleRegistry } from "@framework/ModuleRegistry";

import { preview } from "./preview";
import state from "./state";

ModuleRegistry.registerModule<state>({ moduleName: "Grid3DIntersection", defaultTitle: "3D grid intersection" });
ModuleRegistry.registerModule<state>({ moduleName: "Grid3DIntersection", defaultTitle: "3D grid intersection", preview });
8 changes: 8 additions & 0 deletions frontend/src/modules/Map/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { DrawPreviewFunc } from "@framework/Preview";
import previewImg from "./preview.webp";

export const preview: DrawPreviewFunc = function (width: number, height: number) {
return (
<img src={previewImg} style={{width, height}} className="object-cover object-center" />
);
};
Binary file added frontend/src/modules/Map/preview.webp
Binary file not shown.
2 changes: 2 additions & 0 deletions frontend/src/modules/Map/registerModule.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { ModuleRegistry } from "@framework/ModuleRegistry";
import { SyncSettingKey } from "@framework/SyncSettings";

import { preview } from "./preview";
import { MapState } from "./MapState";

ModuleRegistry.registerModule<MapState>({
moduleName: "Map",
defaultTitle: "Map",
syncableSettingKeys: [SyncSettingKey.ENSEMBLE, SyncSettingKey.SURFACE, SyncSettingKey.DATE],
preview
});
19 changes: 19 additions & 0 deletions frontend/src/modules/Pvt/preview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions frontend/src/modules/Pvt/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { DrawPreviewFunc } from "@framework/Preview";
import previewImg from "./preview.svg";

export const preview: DrawPreviewFunc = function (width: number, height: number) {
return <img src={previewImg} style={{width, height}} />
};
3 changes: 2 additions & 1 deletion frontend/src/modules/Pvt/registerModule.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ModuleRegistry } from "@framework/ModuleRegistry";

import { preview } from "./preview";
import state from "./state";

ModuleRegistry.registerModule<state>({ moduleName: "Pvt", defaultTitle: "PVT" });
ModuleRegistry.registerModule<state>({ moduleName: "Pvt", defaultTitle: "PVT", preview });
14 changes: 14 additions & 0 deletions frontend/src/modules/WellCompletions/preview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions frontend/src/modules/WellCompletions/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { DrawPreviewFunc } from "@framework/Preview";
import previewImg from "./preview.svg";

export const preview: DrawPreviewFunc = function (width: number, height: number) {
return <img src={previewImg} style={{width, height}} />
};
3 changes: 2 additions & 1 deletion frontend/src/modules/WellCompletions/registerModule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ModuleRegistry } from "@framework/ModuleRegistry";

import { preview } from "./preview";
import { State } from "./state";

ModuleRegistry.registerModule<State>({ moduleName: "WellCompletions", defaultTitle: "Well Completions" });
ModuleRegistry.registerModule<State>({ moduleName: "WellCompletions", defaultTitle: "Well Completions", preview });

0 comments on commit bb83fa9

Please sign in to comment.