@webviz/subsurface-viewer 1.11.10 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ColorLegend.d.ts +2 -2
- package/dist/layers/colormap/colormapLayer.d.ts +2 -2
- package/dist/layers/grid3d/grid3dLayer.d.ts +2 -2
- package/dist/layers/grid3d/privateGrid3dLayer.d.ts +2 -2
- package/dist/layers/map/mapLayer.d.ts +2 -2
- package/dist/layers/map/privateMapLayer.d.ts +2 -2
- package/dist/layers/utils/colormapTools.d.ts +8 -6
- package/dist/layers/utils/colormapTools.js +1 -1
- package/dist/layers/utils/colormapTools.js.map +1 -1
- package/dist/layers/wells/wellsLayer.d.ts +2 -2
- package/package.json +1 -1
@@ -3,12 +3,12 @@ import React from "react";
|
|
3
3
|
import type { Color } from "@deck.gl/core";
|
4
4
|
import type { colorTablesArray } from "@emerson-eps/color-tables/";
|
5
5
|
import type { ExtendedLegendLayer } from "../layers/utils/layerTools";
|
6
|
-
import type {
|
6
|
+
import type { ColormapFunctionType } from "../layers/utils/colormapTools";
|
7
7
|
interface LegendBaseData {
|
8
8
|
title: string;
|
9
9
|
colorName: string;
|
10
10
|
discrete: boolean;
|
11
|
-
colorMapFunction?:
|
11
|
+
colorMapFunction?: ColormapFunctionType;
|
12
12
|
}
|
13
13
|
export interface DiscreteLegendDataType extends LegendBaseData {
|
14
14
|
metadata: Record<string, [Color, number]>;
|
@@ -4,12 +4,12 @@ import type { BitmapLayerPickingInfo, BitmapLayerProps } from "@deck.gl/layers";
|
|
4
4
|
import { BitmapLayer } from "@deck.gl/layers";
|
5
5
|
import type { Model } from "@luma.gl/engine";
|
6
6
|
import type { LayerPickInfo, ReportBoundingBoxAction, TypeAndNameLayerProps } from "../utils/layerTools";
|
7
|
-
import { type
|
7
|
+
import { type ColormapFunctionType } from "../utils/colormapTools";
|
8
8
|
import { type ValueDecoder } from "../utils/propertyMapTools";
|
9
9
|
import type { ContinuousLegendDataType } from "../../components/ColorLegend";
|
10
10
|
export interface ColormapLayerProps extends BitmapLayerProps, TypeAndNameLayerProps {
|
11
11
|
colorMapName: string;
|
12
|
-
colorMapFunction?:
|
12
|
+
colorMapFunction?: ColormapFunctionType;
|
13
13
|
valueRange: [number, number];
|
14
14
|
colorMapRange: [number, number];
|
15
15
|
valueDecoder: ValueDecoder;
|
@@ -4,7 +4,7 @@ import { CompositeLayer } from "@deck.gl/core";
|
|
4
4
|
import type { Material } from "../gpglLayers/typeDefs";
|
5
5
|
import PrivateLayer from "./privateGrid3dLayer";
|
6
6
|
import type { ExtendedLayerProps, ReportBoundingBoxAction } from "../utils/layerTools";
|
7
|
-
import type {
|
7
|
+
import type { ColormapFunctionType } from "../utils/colormapTools";
|
8
8
|
export type WebWorkerParams = {
|
9
9
|
points: Float32Array;
|
10
10
|
polys: Uint32Array;
|
@@ -92,7 +92,7 @@ export interface Grid3DLayerProps extends ExtendedLayerProps {
|
|
92
92
|
* E.g. [255, 0, 0] for constant red cells.
|
93
93
|
* Can be defined as Uint8Array containing [R, G, B] triplets in [0, 255] range each.
|
94
94
|
*/
|
95
|
-
colorMapFunction?:
|
95
|
+
colorMapFunction?: ColormapFunctionType | Uint8Array;
|
96
96
|
/**
|
97
97
|
* Value in propertiesData indicating that the property is undefined.
|
98
98
|
* When propertiesData is Uint16Array the value is index in discretePropertyValueNames if provided.
|
@@ -3,7 +3,7 @@ import { Layer } from "@deck.gl/core";
|
|
3
3
|
import type { UniformValue } from "@luma.gl/core";
|
4
4
|
import { Model } from "@luma.gl/engine";
|
5
5
|
import type { DeckGLLayerContext, ExtendedLayerProps, LayerPickInfo } from "../utils/layerTools";
|
6
|
-
import { type
|
6
|
+
import { type ColormapFunctionType } from "../utils/colormapTools";
|
7
7
|
import { TGrid3DColoringMode, type IDiscretePropertyValueName } from "./grid3dLayer";
|
8
8
|
import type { MeshType, MeshTypeLines } from "./typeDefs";
|
9
9
|
export interface PrivateLayerProps extends ExtendedLayerProps {
|
@@ -14,7 +14,7 @@ export interface PrivateLayerProps extends ExtendedLayerProps {
|
|
14
14
|
colormapClampColor: Color | undefined | boolean;
|
15
15
|
undefinedPropertyValue: number;
|
16
16
|
undefinedPropertyColor: [number, number, number];
|
17
|
-
colormapFunction?:
|
17
|
+
colormapFunction?: ColormapFunctionType;
|
18
18
|
coloringMode: TGrid3DColoringMode.Property;
|
19
19
|
gridLines: boolean;
|
20
20
|
propertyValueRange: [number, number];
|
@@ -2,7 +2,7 @@ import type React from "react";
|
|
2
2
|
import type { Color, CompositeLayerProps, Layer, Material, UpdateParameters } from "@deck.gl/core";
|
3
3
|
import { CompositeLayer } from "@deck.gl/core";
|
4
4
|
import type { ReportBoundingBoxAction, ExtendedLayerProps } from "../utils/layerTools";
|
5
|
-
import type {
|
5
|
+
import type { ColormapFunctionType } from "../utils/colormapTools";
|
6
6
|
import PrivateMapLayer from "./privateMapLayer";
|
7
7
|
type Frame = {
|
8
8
|
/** mesh origin
|
@@ -89,7 +89,7 @@ export interface MapLayerProps extends ExtendedLayerProps {
|
|
89
89
|
* May also be set as constant color:
|
90
90
|
* E.g. [255, 0, 0] for constant red surface.
|
91
91
|
*/
|
92
|
-
colorMapFunction?:
|
92
|
+
colorMapFunction?: ColormapFunctionType;
|
93
93
|
/** Surface material properties.
|
94
94
|
* material: true = default material, coloring depends on surface orientation and lighting.
|
95
95
|
* false = no material, coloring is independent on surface orientation and lighting.
|
@@ -3,7 +3,7 @@ import { Layer } from "@deck.gl/core";
|
|
3
3
|
import type { Device, UniformValue } from "@luma.gl/core";
|
4
4
|
import { Model } from "@luma.gl/engine";
|
5
5
|
import type { DeckGLLayerContext, ExtendedLayerProps, LayerPickInfo } from "../utils/layerTools";
|
6
|
-
import { type
|
6
|
+
import { type ColormapFunctionType } from "../utils/colormapTools";
|
7
7
|
export interface PrivateMapLayerProps extends ExtendedLayerProps {
|
8
8
|
positions: Float32Array;
|
9
9
|
normals: Float32Array;
|
@@ -17,7 +17,7 @@ export interface PrivateMapLayerProps extends ExtendedLayerProps {
|
|
17
17
|
colormapName: string;
|
18
18
|
colormapRange: [number, number];
|
19
19
|
colormapClampColor: Color | undefined | boolean;
|
20
|
-
colormapFunction?:
|
20
|
+
colormapFunction?: ColormapFunctionType;
|
21
21
|
propertyValueRange: [number, number];
|
22
22
|
smoothShading: boolean;
|
23
23
|
depthTest: boolean;
|
@@ -2,9 +2,11 @@ import type { Texture } from "@luma.gl/core";
|
|
2
2
|
import type { colorTablesArray, createColorMapFunction as createColormapFunction } from "@emerson-eps/color-tables/";
|
3
3
|
import type { DeckGLLayerContext } from "./layerTools";
|
4
4
|
/** Type of functions returning a color from a value in the [0,1] range. */
|
5
|
-
export type
|
6
|
-
/** @deprecated Use
|
7
|
-
export type colorMapFunctionType =
|
5
|
+
export type ColormapFunctionType = ReturnType<typeof createColormapFunction>;
|
6
|
+
/** @deprecated Use ColormapFunctionType instead. */
|
7
|
+
export type colorMapFunctionType = ColormapFunctionType;
|
8
|
+
/** @deprecated Use ColormapFunctionType instead. */
|
9
|
+
export type ColorMapFunctionType = ColormapFunctionType;
|
8
10
|
export interface IColormapHints {
|
9
11
|
discreteData: boolean;
|
10
12
|
colormapSize: number;
|
@@ -26,15 +28,15 @@ export interface ColorTableProps {
|
|
26
28
|
export interface ColorTableDef extends ColorTableProps {
|
27
29
|
colorTables: colorTablesArray;
|
28
30
|
}
|
29
|
-
export type ColormapProps =
|
31
|
+
export type ColormapProps = ColormapFunctionType | Uint8Array | ColorTableProps;
|
30
32
|
/**
|
31
33
|
* Represents the possible types that can be used as colormap properties.
|
32
34
|
*
|
33
|
-
* - `
|
35
|
+
* - `ColormapFunctionType`: A function converting a value to a color.
|
34
36
|
* - `Uint8Array`: A typed array containing color data.
|
35
37
|
* - `ColorTableDef`: An object representing a color table.
|
36
38
|
*/
|
37
|
-
export type TColormapDef =
|
39
|
+
export type TColormapDef = ColormapFunctionType | Uint8Array | ColorTableDef;
|
38
40
|
/**
|
39
41
|
* Creates an array of colors as RGB triplets in range [0, 1] using the colormap definition.
|
40
42
|
* @param colormapDef Definition of the colormap.
|
@@ -9,7 +9,7 @@ import { createDefaultContinuousColorScale } from "@emerson-eps/color-tables/dis
|
|
9
9
|
*/
|
10
10
|
export function getImageData(colormapDef, colormapSize = 256, discreteColormapFunction = false) {
|
11
11
|
if (colormapDef instanceof Uint8Array) {
|
12
|
-
// If
|
12
|
+
// If colormapProps is a Uint8Array, return it directly
|
13
13
|
return colormapDef;
|
14
14
|
}
|
15
15
|
const isFunctionDefined = colormapDef !== undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"colormapTools.js","sourceRoot":"","sources":["../../../src/layers/utils/colormapTools.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,qEAAqE,CAAC;
|
1
|
+
{"version":3,"file":"colormapTools.js","sourceRoot":"","sources":["../../../src/layers/utils/colormapTools.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,qEAAqE,CAAC;AA8CxH;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CACxB,WAAyB,EACzB,eAAuB,GAAG,EAC1B,2BAAoC,KAAK;IAIzC,IAAI,WAAW,YAAY,UAAU,EAAE,CAAC;QACpC,uDAAuD;QACvD,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,MAAM,iBAAiB,GAAG,WAAW,KAAK,SAAS,CAAC;IACpD,MAAM,eAAe,GACjB,cAAc,IAAI,WAAW;QAC7B,aAAa,IAAI,WAAW;QAC5B,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC;IAE9B,IAAI,QAAQ,GAAG,iCAAiC,EAAyB,CAAC;IAE1E,IAAI,eAAe,EAAE,CAAC;QAClB,IAAI,WAAW,CAAC,YAAY,EAAE,CAAC;YAC3B,QAAQ,GAAG,CAAC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AO,eAAe,CAAC;IAC3B,CAAC;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IAEpC,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,iCAC7C,YAAY,KACf,IAAI,EAAE,IAAI,IACZ,CAAC;IACH,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
@@ -4,7 +4,7 @@ import { CompositeLayer } from "@deck.gl/core";
|
|
4
4
|
import type { BinaryFeatureCollection } from "@loaders.gl/schema";
|
5
5
|
import type { Feature } from "geojson";
|
6
6
|
import type { ReportBoundingBoxAction, ExtendedLayerProps } from "../utils/layerTools";
|
7
|
-
import type {
|
7
|
+
import type { ColormapFunctionType } from "../utils/colormapTools";
|
8
8
|
import type { ContinuousLegendDataType, DiscreteLegendDataType } from "../../components/ColorLegend";
|
9
9
|
import type { WellLabelLayerProps } from "./layers/wellLabelLayer";
|
10
10
|
import { WellLabelLayer } from "./layers/wellLabelLayer";
|
@@ -48,7 +48,7 @@ export interface WellsLayerProps extends ExtendedLayerProps {
|
|
48
48
|
*/
|
49
49
|
refine: boolean | number;
|
50
50
|
wellHeadStyle: WellHeadStyleAccessor;
|
51
|
-
colorMappingFunction:
|
51
|
+
colorMappingFunction: ColormapFunctionType;
|
52
52
|
lineStyle: LineStyleAccessor;
|
53
53
|
/**
|
54
54
|
* @deprecated use wellLabel instead
|