@webviz/subsurface-viewer 0.19.0 → 0.20.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/layers/grid3d/fragment.fs.glsl.d.ts +1 -1
- package/dist/layers/grid3d/fragment.fs.glsl.js +16 -11
- package/dist/layers/grid3d/fragment.fs.glsl.js.map +1 -1
- package/dist/layers/grid3d/grid3dLayer.d.ts +6 -3
- package/dist/layers/grid3d/grid3dLayer.js +18 -22
- package/dist/layers/grid3d/grid3dLayer.js.map +1 -1
- package/dist/layers/grid3d/privateGrid3dLayer.d.ts +2 -0
- package/dist/layers/grid3d/privateGrid3dLayer.js +60 -29
- package/dist/layers/grid3d/privateGrid3dLayer.js.map +1 -1
- package/dist/layers/polylines/polylinesLayer.d.ts +1 -1
- package/dist/storybook/layers/__image_snapshots__/subsurfaceviewer-grid3d-layer--discrete-property.png +0 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
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;\nin float property;\n\nflat in int vertexIndex;\n\nuniform sampler2D colormap;\n\nuniform float colorMapRangeMin;\nuniform float colorMapRangeMax;\n\nuniform vec3 colorMapClampColor;\nuniform bool isClampColor;\nuniform bool isColorMapClampColorTransparent;\n\
|
|
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;\nin float property;\n\nflat in int vertexIndex;\n\nuniform sampler2D colormap;\n\nuniform float colorMapRangeMin;\nuniform float colorMapRangeMax;\n\nuniform vec3 colorMapClampColor;\nuniform bool isClampColor;\nuniform bool isColorMapClampColorTransparent;\n\n// Calculate color from propertyValue using colormap.\nvec4 getPropertyColor (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 return color;\n }\n else {\n // Use min/max color to clamp.\n x = max(0.0, x);\n x = min(1.0, x);\n color = texture2D(colormap, vec2(x, 0.5));\n }\n }\n else {\n color = texture2D(colormap, vec2(x, 0.5));\n }\n return color;\n}\n\nvoid main(void) {\n\n if (picking_uActive && !picking_uAttribute) {\n gl_FragColor = encodeVertexIndexToRGB(vertexIndex); \n return;\n }\n\n vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n \n vec4 color = getPropertyColor(property);\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 gl_FragColor = vec4(lightColor, 1.0);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";
|
|
2
2
|
export default fsShader;
|
|
@@ -18,18 +18,10 @@ uniform vec3 colorMapClampColor;
|
|
|
18
18
|
uniform bool isClampColor;
|
|
19
19
|
uniform bool isColorMapClampColorTransparent;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
// Calculate color from propertyValue using colormap.
|
|
22
|
+
vec4 getPropertyColor (float propertyValue) {
|
|
22
23
|
|
|
23
|
-
if (picking_uActive && !picking_uAttribute) {
|
|
24
|
-
gl_FragColor = encodeVertexIndexToRGB(vertexIndex);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
|
|
29
|
-
|
|
30
|
-
// Calculate color from propertyValue using colormap.
|
|
31
24
|
vec4 color = vec4(1.0, 1.0, 1.0, 1.0);
|
|
32
|
-
float propertyValue = property;
|
|
33
25
|
float x = (propertyValue - colorMapRangeMin) / (colorMapRangeMax - colorMapRangeMin);
|
|
34
26
|
if (x < 0.0 || x > 1.0) {
|
|
35
27
|
// Out of range. Use clampcolor.
|
|
@@ -39,7 +31,7 @@ void main(void) {
|
|
|
39
31
|
}
|
|
40
32
|
else if (isColorMapClampColorTransparent) {
|
|
41
33
|
discard;
|
|
42
|
-
return;
|
|
34
|
+
return color;
|
|
43
35
|
}
|
|
44
36
|
else {
|
|
45
37
|
// Use min/max color to clamp.
|
|
@@ -51,7 +43,20 @@ void main(void) {
|
|
|
51
43
|
else {
|
|
52
44
|
color = texture2D(colormap, vec2(x, 0.5));
|
|
53
45
|
}
|
|
46
|
+
return color;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
void main(void) {
|
|
50
|
+
|
|
51
|
+
if (picking_uActive && !picking_uAttribute) {
|
|
52
|
+
gl_FragColor = encodeVertexIndexToRGB(vertexIndex);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
54
55
|
|
|
56
|
+
vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
|
|
57
|
+
|
|
58
|
+
vec4 color = getPropertyColor(property);
|
|
59
|
+
|
|
55
60
|
// Use two sided phong lighting. This has no effect if "material" property is not set.
|
|
56
61
|
vec3 lightColor = getPhongLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
|
|
57
62
|
gl_FragColor = vec4(lightColor, 1.0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fragment.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/fragment.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG
|
|
1
|
+
{"version":3,"file":"fragment.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/fragment.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -8,7 +8,7 @@ import type { ReportBoundingBoxAction } from "../../components/Map";
|
|
|
8
8
|
export type WebWorkerParams = {
|
|
9
9
|
points: Float32Array;
|
|
10
10
|
polys: Uint32Array;
|
|
11
|
-
properties: Float32Array;
|
|
11
|
+
properties: Float32Array | Uint16Array;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Enumerates possible coloring modes of Grid3D Layer.
|
|
@@ -33,8 +33,10 @@ export interface Grid3DLayerProps extends ExtendedLayerProps {
|
|
|
33
33
|
/** Url, or native, or typed javascript array.
|
|
34
34
|
* A scalar property for each polygon.
|
|
35
35
|
* [0.23, 0.11. 0.98, ...]
|
|
36
|
+
* If propertiesData is provided as Uint16Array it is assumed that all the values are in range [0, N].
|
|
37
|
+
* If colorMapFunction is Uint8Array the property values are used as color indices.
|
|
36
38
|
*/
|
|
37
|
-
propertiesData: string | number[] | Float32Array;
|
|
39
|
+
propertiesData: string | number[] | Float32Array | Uint16Array;
|
|
38
40
|
/**
|
|
39
41
|
* Defines how the cells are to be colored:
|
|
40
42
|
* by property value or by a coordinate.
|
|
@@ -58,8 +60,9 @@ export interface Grid3DLayerProps extends ExtendedLayerProps {
|
|
|
58
60
|
* E.g. (x) => [x * 255, x * 255, x * 255]
|
|
59
61
|
* May also be set as constant color:
|
|
60
62
|
* E.g. [255, 0, 0] for constant red cells.
|
|
63
|
+
* Can be defined as Uint8Array containing [R , G, B] triplets in [0, 255] range each.
|
|
61
64
|
*/
|
|
62
|
-
colorMapFunction?: colorMapFunctionType;
|
|
65
|
+
colorMapFunction?: colorMapFunctionType | Uint8Array;
|
|
63
66
|
/** Enable lines around cell faces.
|
|
64
67
|
* default: true.
|
|
65
68
|
*/
|
|
@@ -44,41 +44,36 @@ function GetBBox(points) {
|
|
|
44
44
|
}
|
|
45
45
|
return [xmin, ymin, zmin, xmax, ymax, zmax];
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function loadData(data, type) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
if (data instanceof
|
|
49
|
+
if (data instanceof type) {
|
|
50
50
|
return data;
|
|
51
51
|
}
|
|
52
52
|
if (Array.isArray(data)) {
|
|
53
|
-
return new
|
|
53
|
+
return new type(data);
|
|
54
54
|
}
|
|
55
55
|
if (typeof data === "string") {
|
|
56
56
|
const stringData = yield load(data, JSONLoader);
|
|
57
|
-
return new
|
|
57
|
+
return new type(stringData);
|
|
58
58
|
}
|
|
59
59
|
return Promise.reject("Grid3DLayer: Unsupported type of input data");
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function loadPropertiesData(propertiesData) {
|
|
63
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return new Uint32Array(data);
|
|
69
|
-
}
|
|
70
|
-
if (typeof data === "string") {
|
|
71
|
-
const stringData = yield load(data, JSONLoader);
|
|
72
|
-
return new Uint32Array(stringData);
|
|
73
|
-
}
|
|
74
|
-
return Promise.reject("Grid3DLayer: Unsupported type of input data");
|
|
64
|
+
const isPropertiesDiscrete = propertiesData instanceof Uint16Array;
|
|
65
|
+
return isPropertiesDiscrete
|
|
66
|
+
? yield loadData(propertiesData, Uint16Array)
|
|
67
|
+
: yield loadData(propertiesData, Float32Array);
|
|
75
68
|
});
|
|
76
69
|
}
|
|
77
|
-
function load_data(pointsData, polysData, propertiesData) {
|
|
70
|
+
function load_data(pointsData, polysData, propertiesData, loadProperties) {
|
|
78
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
const points = yield
|
|
80
|
-
const polys = yield
|
|
81
|
-
const properties =
|
|
72
|
+
const points = yield loadData(pointsData, Float32Array);
|
|
73
|
+
const polys = yield loadData(polysData, Uint32Array);
|
|
74
|
+
const properties = loadProperties
|
|
75
|
+
? yield loadPropertiesData(propertiesData)
|
|
76
|
+
: new Float32Array();
|
|
82
77
|
return Promise.all([points, polys, properties]);
|
|
83
78
|
});
|
|
84
79
|
}
|
|
@@ -116,7 +111,7 @@ export default class Grid3DLayer extends CompositeLayer {
|
|
|
116
111
|
return isLoaded && isFinished;
|
|
117
112
|
}
|
|
118
113
|
rebuildData(reportBoundingBox) {
|
|
119
|
-
const p = load_data(this.props.pointsData, this.props.polysData, this.props.propertiesData);
|
|
114
|
+
const p = load_data(this.props.pointsData, this.props.polysData, this.props.propertiesData, this.props.coloringMode === TGrid3DColoringMode.Property);
|
|
120
115
|
p.then(([points, polys, properties]) => {
|
|
121
116
|
const bbox = GetBBox(points);
|
|
122
117
|
// Using inline web worker for calculating the triangle mesh from
|
|
@@ -193,13 +188,14 @@ export default class Grid3DLayer extends CompositeLayer {
|
|
|
193
188
|
}
|
|
194
189
|
getPropertyValueRange() {
|
|
195
190
|
const bbox = this.state["bbox"];
|
|
191
|
+
const zSign = this.props.ZIncreasingDownwards ? -1.0 : 1.0;
|
|
196
192
|
switch (this.props.coloringMode) {
|
|
197
193
|
case TGrid3DColoringMode.X:
|
|
198
194
|
return [bbox[0], bbox[3]];
|
|
199
195
|
case TGrid3DColoringMode.Y:
|
|
200
196
|
return [bbox[1], bbox[4]];
|
|
201
197
|
case TGrid3DColoringMode.Z:
|
|
202
|
-
return [bbox[2], bbox[5]];
|
|
198
|
+
return [zSign * bbox[2], zSign * bbox[5]];
|
|
203
199
|
default:
|
|
204
200
|
return this.state["propertyValueRange"];
|
|
205
201
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid3dLayer.js","sourceRoot":"","sources":["../../../src/layers/grid3d/grid3dLayer.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGjC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAA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AMP_TO_EDGE,
|
|
15
15
|
[GL.TEXTURE_WRAP_T]: GL.CLAMP_TO_EDGE,
|
|
16
16
|
};
|
|
17
|
+
const DISCRETE_TEXTURE_PARAMETERS = {
|
|
18
|
+
[GL.TEXTURE_MIN_FILTER]: GL.LINEAR_MIPMAP_LINEAR,
|
|
19
|
+
[GL.TEXTURE_MAG_FILTER]: GL.NEAREST,
|
|
20
|
+
[GL.TEXTURE_WRAP_S]: GL.CLAMP_TO_EDGE,
|
|
21
|
+
[GL.TEXTURE_WRAP_T]: GL.CLAMP_TO_EDGE,
|
|
22
|
+
};
|
|
17
23
|
const defaultProps = {
|
|
18
24
|
colorMapName: "",
|
|
19
25
|
colorMapClampColor: [200, 200, 200],
|
|
@@ -80,47 +86,20 @@ export default class PrivateLayer extends Layer {
|
|
|
80
86
|
// Signature from the base class, eslint doesn't like the any type.
|
|
81
87
|
// eslint-disable-next-line
|
|
82
88
|
draw(args) {
|
|
83
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
84
89
|
if (!this.state["models"]) {
|
|
85
90
|
return;
|
|
86
91
|
}
|
|
87
92
|
const { uniforms, context } = args;
|
|
88
93
|
const { gl } = context;
|
|
89
94
|
const [model_mesh, mesh_lines_model] = this.state["models"];
|
|
90
|
-
const valueRangeMin = (_b = (_a = this.props.propertyValueRange) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 0.0;
|
|
91
|
-
const valueRangeMax = (_d = (_c = this.props.propertyValueRange) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : 1.0;
|
|
92
|
-
// If specified color map will extend from colorMapRangeMin to colorMapRangeMax.
|
|
93
|
-
// Otherwise it will extend from valueRangeMin to valueRangeMax.
|
|
94
|
-
const colorMapRangeMin = (_f = (_e = this.props.colorMapRange) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : valueRangeMin;
|
|
95
|
-
const colorMapRangeMax = (_h = (_g = this.props.colorMapRange) === null || _g === void 0 ? void 0 : _g[1]) !== null && _h !== void 0 ? _h : valueRangeMax;
|
|
96
|
-
const isClampColor = this.props.colorMapClampColor !== undefined &&
|
|
97
|
-
this.props.colorMapClampColor !== true &&
|
|
98
|
-
this.props.colorMapClampColor !== false;
|
|
99
|
-
let colorMapClampColor = isClampColor
|
|
100
|
-
? this.props.colorMapClampColor
|
|
101
|
-
: [0, 0, 0];
|
|
102
|
-
// Normalize to [0,1] range.
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
104
|
-
// @ts-ignore
|
|
105
|
-
colorMapClampColor = colorMapClampColor.map((x) => (x !== null && x !== void 0 ? x : 0) / 255);
|
|
106
|
-
const isColorMapClampColorTransparent = this.props.colorMapClampColor === false;
|
|
107
95
|
gl.enable(gl.POLYGON_OFFSET_FILL);
|
|
108
96
|
gl.polygonOffset(1, 1);
|
|
109
97
|
if (!this.props.depthTest) {
|
|
110
98
|
gl.disable(gl.DEPTH_TEST);
|
|
111
99
|
}
|
|
100
|
+
const propertyUniforms = this.getPropertyUniforms(context);
|
|
112
101
|
model_mesh
|
|
113
|
-
.setUniforms(Object.assign(Object.assign({}, uniforms), {
|
|
114
|
-
width: 256,
|
|
115
|
-
height: 1,
|
|
116
|
-
format: GL.RGB,
|
|
117
|
-
data: getImageData(this.props.colorMapName, this.context.userData
|
|
118
|
-
.colorTables, this.props.colorMapFunction),
|
|
119
|
-
parameters: DEFAULT_TEXTURE_PARAMETERS,
|
|
120
|
-
}), colorMapRangeMin,
|
|
121
|
-
colorMapRangeMax,
|
|
122
|
-
colorMapClampColor, coloringMode: this.props.coloringMode, isColorMapClampColorTransparent,
|
|
123
|
-
isClampColor, ZIncreasingDownwards: this.props.ZIncreasingDownwards }))
|
|
102
|
+
.setUniforms(Object.assign(Object.assign(Object.assign({}, uniforms), propertyUniforms), { coloringMode: this.props.coloringMode, ZIncreasingDownwards: this.props.ZIncreasingDownwards }))
|
|
124
103
|
.draw();
|
|
125
104
|
gl.disable(gl.POLYGON_OFFSET_FILL);
|
|
126
105
|
// Draw lines.
|
|
@@ -166,6 +145,58 @@ export default class PrivateLayer extends Layer {
|
|
|
166
145
|
}
|
|
167
146
|
return Object.assign(Object.assign({}, info), { properties: layer_properties });
|
|
168
147
|
}
|
|
148
|
+
getImageData() {
|
|
149
|
+
if (this.props.colorMapFunction instanceof Uint8Array) {
|
|
150
|
+
return {
|
|
151
|
+
imageData: this.props.colorMapFunction,
|
|
152
|
+
count: this.props.colorMapFunction.length / 3,
|
|
153
|
+
parameters: DISCRETE_TEXTURE_PARAMETERS,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
const imageData = getImageData(this.props.colorMapName, this.context.userData.colorTables, this.props.colorMapFunction);
|
|
157
|
+
return {
|
|
158
|
+
imageData,
|
|
159
|
+
count: 256,
|
|
160
|
+
parameters: DEFAULT_TEXTURE_PARAMETERS,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
// eslint-disable-next-line
|
|
164
|
+
getPropertyUniforms(context) {
|
|
165
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
166
|
+
const valueRangeMin = (_b = (_a = this.props.propertyValueRange) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 0.0;
|
|
167
|
+
const valueRangeMax = (_d = (_c = this.props.propertyValueRange) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : 1.0;
|
|
168
|
+
// If specified color map will extend from colorMapRangeMin to colorMapRangeMax.
|
|
169
|
+
// Otherwise it will extend from valueRangeMin to valueRangeMax.
|
|
170
|
+
const colorMapRangeMin = (_f = (_e = this.props.colorMapRange) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : valueRangeMin;
|
|
171
|
+
const colorMapRangeMax = (_h = (_g = this.props.colorMapRange) === null || _g === void 0 ? void 0 : _g[1]) !== null && _h !== void 0 ? _h : valueRangeMax;
|
|
172
|
+
const isClampColor = this.props.colorMapClampColor !== undefined &&
|
|
173
|
+
this.props.colorMapClampColor !== true &&
|
|
174
|
+
this.props.colorMapClampColor !== false;
|
|
175
|
+
let colorMapClampColor = isClampColor
|
|
176
|
+
? this.props.colorMapClampColor
|
|
177
|
+
: [0, 0, 0];
|
|
178
|
+
// Normalize to [0,1] range.
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
180
|
+
// @ts-ignore
|
|
181
|
+
colorMapClampColor = colorMapClampColor.map((x) => (x !== null && x !== void 0 ? x : 0) / 255);
|
|
182
|
+
const isColorMapClampColorTransparent = this.props.colorMapClampColor === false;
|
|
183
|
+
const imageData = this.getImageData();
|
|
184
|
+
const colormap = new Texture2D(context.gl, {
|
|
185
|
+
width: imageData.count,
|
|
186
|
+
height: 1,
|
|
187
|
+
format: GL.RGB,
|
|
188
|
+
data: imageData.imageData,
|
|
189
|
+
parameters: imageData.parameters,
|
|
190
|
+
});
|
|
191
|
+
return {
|
|
192
|
+
colormap,
|
|
193
|
+
colorMapRangeMin,
|
|
194
|
+
colorMapRangeMax,
|
|
195
|
+
colorMapClampColor,
|
|
196
|
+
isColorMapClampColorTransparent,
|
|
197
|
+
isClampColor,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
169
200
|
}
|
|
170
201
|
PrivateLayer.layerName = "PrivateLayer";
|
|
171
202
|
PrivateLayer.defaultProps = defaultProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privateGrid3dLayer.js","sourceRoot":"","sources":["../../../src/layers/grid3d/privateGrid3dLayer.ts"],"names":[],"mappings":"AACA,OAAO,EACH,iBAAiB,EACjB,KAAK,EACL,OAAO,EACP,OAAO,GACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAQlD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,g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,KAAK,CAAC,kBAA8B,KAAK,KAAK,CAAC;QAEzD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAEtC,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE;YACvC,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,EAAE,CAAC,GAAG;YACd,IAAI,EAAE,SAAS,CAAC,SAAS;YACzB,UAAU,EAAE,SAAS,CAAC,UAAU;SACnC,CAAC,CAAC;QAEH,OAAO;YACH,QAAQ;YACR,gBAAgB;YAChB,gBAAgB;YAChB,kBAAkB;YAClB,+BAA+B;YAC/B,YAAY;SACf,CAAC;IACN,CAAC;CACJ;AAED,YAAY,CAAC,SAAS,GAAG,cAAc,CAAC;AACxC,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC"}
|
|
@@ -11,7 +11,7 @@ export interface PolylinesLayerProps extends ExtendedLayerProps {
|
|
|
11
11
|
polylinePoints: number[] | Float32Array;
|
|
12
12
|
/**
|
|
13
13
|
Start indices of the polylines counted in vertex indices.
|
|
14
|
-
For example, if there are 3
|
|
14
|
+
For example, if there are 3 polylines of 2, 3, and 4 vertices each, startIndices should be [0, 2, 5].
|
|
15
15
|
*/
|
|
16
16
|
startIndices: number[] | Uint32Array;
|
|
17
17
|
/** Array of boolean flags or a single value indicating whether the polylines are closed.
|
|
Binary file
|