@webviz/subsurface-viewer
Version:
3D visualization component for subsurface reservoir data
71 lines (70 loc) • 3.06 kB
TypeScript
import { Matrix4 } from "math.gl";
import type { PickingInfo } from "@deck.gl/core";
import type { Color, LayerContext } from "@deck.gl/core";
import type { Layer, LayersList, LayerManager, CompositeLayerProps } from "@deck.gl/core";
import type { colorTablesArray } from "@emerson-eps/color-tables/";
import type { ContinuousLegendDataType, DiscreteLegendDataType } from "../../components/ColorLegend";
import type { BoundingBox3D } from "../../utils";
export interface TypeAndNameLayerProps {
"@@type"?: string;
name: string;
}
export interface ExtendedLayerProps extends CompositeLayerProps, TypeAndNameLayerProps {
}
export interface ExtendedLegendLayer extends Layer {
getLegendData?: () => DiscreteLegendDataType | ContinuousLegendDataType;
}
export interface DeckGLLayerContext extends LayerContext {
userData: {
setEditedData: (data: Record<string, unknown>) => void;
colorTables: colorTablesArray;
};
}
export interface PropertyDataType {
name: string;
value: string | number;
color?: Color;
}
export interface LayerPickInfo<T = any> extends PickingInfo<T> {
propertyValue?: number;
properties?: PropertyDataType[];
}
export declare function createPropertyData(name: string, value: string | number, color?: Color): PropertyDataType;
export declare function getModelMatrix(deg: number, x: number, y: number): Matrix4;
export declare function getModelMatrixScale(scaleZ: number): Matrix4;
export declare function getLayersInViewport(layers: Record<string, unknown>[] | LayersList, layerIds: string[] | undefined): Record<string, unknown>[] | LayersList;
export declare function getLayersByType(layers: LayersList, type: string): LayersList;
export type NewLayersList = LayersList & {
id: string;
props: prop;
};
type prop = {
data: wellData;
visible: boolean;
};
type wellData = {
features: feature[];
type: string;
unit?: string;
};
type feature = {
properties: {
name: string;
};
};
export declare function getWellLayerByTypeAndSelectedWells(layers: LayersList, type: string, selectedWell: string): LayersList;
export declare function getLayersById(layers: LayersList, id: string): LayersList;
export declare function isDrawingEnabled(layer_manager: LayerManager): boolean;
export declare function invertZCoordinate(dataArray: Float32Array): void;
/**
* Calculates the axis-aligned bounding box for a set of 3D points.
*
* @param dataArray - A flat `Float32Array` containing 3D coordinates in the order [x0, y0, z0, x1, y1, z1, ...].
* @param zIncreasingDownwards - Optional. If `true`, inverts the Z-axis direction to account for coordinate systems where Z increases downwards. Defaults to `false`.
* @returns A tuple of six numbers: [minX, minY, minZ, maxX, maxY, maxZ], representing the minimum and maximum coordinates along each axis.
*/
export declare function computeBoundingBox(dataArray: Float32Array, zIncreasingDownwards?: boolean): BoundingBox3D;
export type ReportBoundingBoxAction = {
layerBoundingBox: BoundingBox3D;
};
export {};