Skip to content

Commit

Permalink
Merge remote-tracking branch 'rubenthoms/2d-viewer' into 2d-viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Aug 28, 2024
2 parents 760ddae + e1d6da6 commit 93bbc77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion frontend/src/modules/2DViewer/view/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { SurfaceDataFloat_trans } from "@modules/_shared/Surface/queryDataTransf
import { BaseLayer, LayerStatus, useLayers, useLayersStatuses } from "@modules/_shared/layers/BaseLayer";
import { LayerGroup } from "@modules/_shared/layers/LayerGroup";
import { LayerManagerTopic, useLayerManagerTopicValue } from "@modules/_shared/layers/LayerManager";
import { BaseSetting } from "@modules/_shared/layers/settings/BaseSetting";
import { ViewportType } from "@webviz/subsurface-viewer";
import SubsurfaceViewer, { ViewsType } from "@webviz/subsurface-viewer/dist/SubsurfaceViewer";
import { Axes2DLayer, MapLayer, WellsLayer } from "@webviz/subsurface-viewer/dist/layers";
Expand All @@ -28,6 +29,7 @@ export function View(props: ModuleViewProps<Interfaces>): React.ReactNode {
const statusWriter = useViewStatusWriter(props.viewContext);
const layerManager = props.viewContext.useSettingsToViewInterfaceValue("layerManager");
const allItems = useLayerManagerTopicValue(layerManager, LayerManagerTopic.ITEMS_CHANGED);
const mainGroup = layerManager.getMainGroup();

const [prevLayerItems, setPrevLayerItems] = React.useState<BaseLayer<any, any>[]>([]);

Expand All @@ -49,7 +51,10 @@ export function View(props: ModuleViewProps<Interfaces>): React.ReactNode {
| LayerGroup
)[];

for (const item of items) {
for (const item of mainGroup.getItems()) {
if (item instanceof BaseSetting) {
continue;
}
if (!item.getIsVisible()) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/_shared/layers/LayerGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { LayerItem, LayerManager } from "./LayerManager";

export enum LayerGroupTopic {
NAME_CHANGED = "name-changed",
ITEMS_CHANGED = "layer-ids-changed",
ITEMS_CHANGED = "items-changed",
VISIBILITY_CHANGED = "visibility-changed",
}

Expand Down

0 comments on commit 93bbc77

Please sign in to comment.