@webviz/subsurface-viewer 1.1.4 → 1.2.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/components/InfoCard.js +8 -0
- package/dist/components/InfoCard.js.map +1 -1
- package/dist/components/Map.js +9 -6
- package/dist/components/Map.js.map +1 -1
- package/dist/layers/axes2d/axes2DLayer.d.ts +17 -7
- package/dist/layers/axes2d/axes2DLayer.js +109 -66
- package/dist/layers/axes2d/axes2DLayer.js.map +1 -1
- package/dist/layers/colormap/colormapLayer.d.ts +2 -2
- package/dist/layers/grid3d/cellProperty.fs.glsl.d.ts +2 -0
- package/dist/layers/grid3d/{fragment.fs.glsl.js → cellProperty.fs.glsl.js} +41 -51
- package/dist/layers/grid3d/cellProperty.fs.glsl.js.map +1 -0
- package/dist/layers/grid3d/cellProperty.vs.glsl.d.ts +2 -0
- package/dist/layers/grid3d/cellProperty.vs.glsl.js +47 -0
- package/dist/layers/grid3d/cellProperty.vs.glsl.js.map +1 -0
- package/dist/layers/grid3d/grid3dLayer.d.ts +27 -7
- package/dist/layers/grid3d/grid3dLayer.js +39 -11
- package/dist/layers/grid3d/grid3dLayer.js.map +1 -1
- package/dist/layers/grid3d/nodeProperty.fs.glsl.d.ts +2 -0
- package/dist/layers/grid3d/nodeProperty.fs.glsl.js +66 -0
- package/dist/layers/grid3d/nodeProperty.fs.glsl.js.map +1 -0
- package/dist/layers/grid3d/nodeProperty.vs.glsl.d.ts +2 -0
- package/dist/layers/grid3d/{vertex.glsl.js → nodeProperty.vs.glsl.js} +17 -13
- package/dist/layers/grid3d/nodeProperty.vs.glsl.js.map +1 -0
- package/dist/layers/grid3d/privateGrid3dLayer.d.ts +4 -5
- package/dist/layers/grid3d/privateGrid3dLayer.js +76 -61
- package/dist/layers/grid3d/privateGrid3dLayer.js.map +1 -1
- package/dist/layers/grid3d/typeDefs.d.ts +1 -1
- package/dist/layers/grid3d/webworker.js +22 -13
- package/dist/layers/grid3d/webworker.js.map +1 -1
- package/dist/layers/map/mapLayer.d.ts +2 -2
- package/dist/layers/map/privateMapLayer.d.ts +2 -2
- package/dist/layers/utils/layerTools.d.ts +9 -4
- package/dist/layers/utils/layerTools.js +12 -7
- package/dist/layers/utils/layerTools.js.map +1 -1
- package/package.json +1 -1
- package/dist/layers/grid3d/fragment.fs.glsl.d.ts +0 -2
- package/dist/layers/grid3d/fragment.fs.glsl.js.map +0 -1
- package/dist/layers/grid3d/vertex.glsl.d.ts +0 -2
- package/dist/layers/grid3d/vertex.glsl.js.map +0 -1
@@ -96,15 +96,17 @@ export function defineBoundingBox(dataArray, zIncreasingDownwards = false) {
|
|
96
96
|
return [minX, minY, minZ, maxX, maxY, maxZ];
|
97
97
|
}
|
98
98
|
/**
|
99
|
-
* Creates an array of
|
99
|
+
* Creates an array of colors as RGB triplets in range [0, 1] using the color map or color map function.
|
100
100
|
* ColorMapFunction has priority.
|
101
101
|
* @param colorMapName Name of the color map in color tables.
|
102
102
|
* @param colorTables Color tables.
|
103
103
|
* @param colorMapFunction Either a function which returns a color
|
104
104
|
* or an array representing a constant color.
|
105
|
-
* @
|
105
|
+
* @param colormapSize Number of colors in the color map.
|
106
|
+
* @param discreteColormapFunction If true, the color map function is targeting indices ranging from 0 to colormapSize.
|
107
|
+
* @returns Array of colors.
|
106
108
|
*/
|
107
|
-
export function getImageData(colorMapName, colorTables, colorMapFunction) {
|
109
|
+
export function getImageData(colorMapName, colorTables, colorMapFunction, colormapSize = 256, discreteColormapFunction = false) {
|
108
110
|
const isColorMapFunctionDefined = typeof colorMapFunction !== "undefined";
|
109
111
|
const isColorMapNameDefined = !!colorMapName;
|
110
112
|
const defaultColorMap = createDefaultContinuousColorScale;
|
@@ -116,12 +118,15 @@ export function getImageData(colorMapName, colorTables, colorMapFunction) {
|
|
116
118
|
: (() => colorMapFunction);
|
117
119
|
}
|
118
120
|
else if (isColorMapNameDefined) {
|
121
|
+
discreteColormapFunction = false;
|
119
122
|
colorMap = (value) => rgbValues(value, colorMapName, colorTables);
|
120
123
|
}
|
121
|
-
const data = new Uint8Array(
|
122
|
-
|
123
|
-
|
124
|
-
|
124
|
+
const data = new Uint8Array(colormapSize * 3);
|
125
|
+
const scaling = discreteColormapFunction
|
126
|
+
? 1
|
127
|
+
: 1 / Math.max(colormapSize - 1, 1);
|
128
|
+
for (let i = 0; i < colormapSize; i++) {
|
129
|
+
const color = colorMap ? colorMap(scaling * i) : [1, 0, 0];
|
125
130
|
if (color) {
|
126
131
|
data[3 * i + 0] = color[0];
|
127
132
|
data[3 * i + 1] = color[1];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"layerTools.js","sourceRoot":"","sources":["../../../src/layers/utils/layerTools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,qEAAqE,CAAC;AAQxH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"layerTools.js","sourceRoot":"","sources":["../../../src/layers/utils/layerTools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,qEAAqE,CAAC;AAQxH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAuClC,uEAAuE;AACvE,oBAAoB;AACpB,MAAM,UAAU,kBAAkB,CAC9B,IAAY,EACZ,KAAsB,EACtB,KAAa;IAEb,OAAO;QACH,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;KACf,CAAC;AACN,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,CAAS,EAAE,CAAS;IAC5D,MAAM,GAAG,GAAG,GAAG,GAAG,QAAQ,CAAC;IAC3B,MAAM,QAAQ,GAAG,CAA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CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
@@ -1,2 +0,0 @@
|
|
1
|
-
declare const fsShader = "#version 300 es\n#define SHADER_NAME grid3d-fragment-shader\n\nprecision highp float;\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\nflat in float property;\nin float property_interpolated;\n\nflat in vec3 normal;\nflat in int vertexIndex;\n\nout vec4 fragColor;\n\nuniform sampler2D colormap;\n\nuniform float valueRangeMin;\nuniform float valueRangeMax;\nuniform float colorMapRangeMin;\nuniform float colorMapRangeMax;\n\nuniform bool isColoringDiscrete;\nuniform float colorMapSize;\nuniform lowp int coloringMode;\n\nuniform vec3 colorMapClampColor;\nuniform vec3 undefinedPropertyColor;\nuniform bool isClampColor;\nuniform bool isColorMapClampColorTransparent;\n\nvec4 getContinuousPropertyColor (float propertyValue) {\n \n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float x = (propertyValue - colorMapRangeMin) / (colorMapRangeMax - colorMapRangeMin);\n if (x < 0.0 || x > 1.0) {\n // Out of range. Use clampcolor.\n if (isClampColor) {\n color = vec4(colorMapClampColor.rgb, 1.0);\n\n }\n else if (isColorMapClampColorTransparent) {\n discard;\n }\n else {\n // Use min/max color to clamp.\n x = clamp (x, 0.0, 1.0); \n color = texture(colormap, vec2(x, 0.5));\n }\n }\n else {\n color = texture(colormap, vec2(x, 0.5));\n }\n return color;\n}\n\n// Calculate color from propertyValue using discrete colormap.\nvec4 getDiscretePropertyColor (float propertyValue) {\n\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float tolerance = (1.0 / colorMapSize) * 0.5;\n\n if (propertyValue < colorMapRangeMin - tolerance || propertyValue > colorMapRangeMax + tolerance) {\n // Out of range. Use clampcolor.\n if (isClampColor) {\n color = vec4(colorMapClampColor.rgb, 1.0);\n\n }\n else if (isColorMapClampColorTransparent) {\n discard;\n }\n else {\n // Use min/max color to clamp.\n float p = clamp (propertyValue, colorMapRangeMin, colorMapRangeMax);\n float x = p / colorMapSize;\n color = texture(colormap, vec2(x, 0.5));\n }\n }\n else {\n float x = propertyValue / colorMapSize;\n color = texture(colormap, vec2(x + tolerance, 0.5));\n }\n return color;\n}\n\nvec4 getPropertyColor (float propertyValue) {\n if(isColoringDiscrete) {\n return getDiscretePropertyColor (propertyValue);\n }\n return getContinuousPropertyColor (propertyValue);\n}\n\nvoid main(void) {\n\n if (picking.isActive > 0.5 && !(picking.isAttribute > 0.5)) {\n fragColor = encodeVertexIndexToRGB(vertexIndex); \n return;\n }\n\n if (coloringMode == 0 && isnan(property)) {\n vec3 lightColor = getPhongLightColor(undefinedPropertyColor.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, 1.0); \n return;\n } \n \n // Property values other than X,Y or Z are passed as \"flat\" i.e. constant over faces.\n float propertyValue = coloringMode == 0 ? property : property_interpolated;\n propertyValue = clamp(propertyValue, valueRangeMin, valueRangeMax);\n\n vec4 color = getPropertyColor(propertyValue);\n\n // Use two sided phong lighting. This has no effect if \"material\" property is not set.\n vec3 lightColor = getPhongLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
|
2
|
-
export default fsShader;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"fragment.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/fragment.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
declare const vsShader = "#version 300 es\n#define SHADER_NAME grid3d-vertex-shader\nprecision highp float;\n\nin vec3 positions;\nin float properties;\nin vec3 normals;\n\nuniform lowp int coloringMode;\n\n// Outputs to fragment shader\nout vec3 cameraPosition;\nout vec4 position_commonspace;\nflat out float property;\nout float property_interpolated;\n\nflat out vec3 normal;\nflat out int vertexIndex;\n\nuniform bool ZIncreasingDownwards;\n\nconst vec3 pickingColor = vec3(1.0, 1.0, 0.0);\n\nvoid main(void) { \n \n vertexIndex = gl_VertexID;\n cameraPosition = project_uCameraPosition; \n geometry.pickingColor = pickingColor;\n\n normal = normals;\n vec3 position = positions;\n\n float zSign = ZIncreasingDownwards ? -1.0 : 1.0;\n\n position.z *= zSign;\n normal.z *= zSign;\n\n switch(coloringMode) {\n case 0: property = properties; break;\n case 1: property_interpolated = position.x; break;\n case 2: property_interpolated = position.y; break;\n case 3: property_interpolated = position.z; break;\n default: property = properties; break;\n }\n\n position_commonspace = vec4(project_position(position), 0.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n";
|
2
|
-
export default vsShader;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"vertex.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/vertex.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|