@webviz/subsurface-viewer 1.17.8 → 1.18.2

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.
Files changed (143) hide show
  1. package/dist/DashSubsurfaceViewer.js +2 -13
  2. package/dist/DashSubsurfaceViewer.js.map +1 -1
  3. package/dist/SubsurfaceViewer.js +10 -16
  4. package/dist/SubsurfaceViewer.js.map +1 -1
  5. package/dist/components/ColorLegend.js +3 -4
  6. package/dist/components/ColorLegend.js.map +1 -1
  7. package/dist/components/ColorLegends.js +6 -1
  8. package/dist/components/ColorLegends.js.map +1 -1
  9. package/dist/components/DistanceScale.js +5 -2
  10. package/dist/components/DistanceScale.js.map +1 -1
  11. package/dist/components/InfoCard.js +9 -13
  12. package/dist/components/InfoCard.js.map +1 -1
  13. package/dist/components/Map.d.ts +15 -1
  14. package/dist/components/Map.js +182 -151
  15. package/dist/components/Map.js.map +1 -1
  16. package/dist/components/settings/DrawModeSelector.js +2 -2
  17. package/dist/components/settings/DrawModeSelector.js.map +1 -1
  18. package/dist/components/settings/Settings.js +1 -1
  19. package/dist/components/settings/Settings.js.map +1 -1
  20. package/dist/extensions/side-projection-extension.js +2 -2
  21. package/dist/extensions/side-projection-extension.js.map +1 -1
  22. package/dist/hooks/useMultiViewCursorTracking/useMultiViewCursorTracking.js +11 -6
  23. package/dist/hooks/useMultiViewCursorTracking/useMultiViewCursorTracking.js.map +1 -1
  24. package/dist/hooks/useMultiViewPicking/MultiViewPickingInfoAssembler.js +83 -97
  25. package/dist/hooks/useMultiViewPicking/MultiViewPickingInfoAssembler.js.map +1 -1
  26. package/dist/hooks/useMultiViewPicking/useMultiViewPicking.js +4 -1
  27. package/dist/hooks/useMultiViewPicking/useMultiViewPicking.js.map +1 -1
  28. package/dist/layers/BoxSelectionLayer/boxSelectionLayer.js +2 -3
  29. package/dist/layers/BoxSelectionLayer/boxSelectionLayer.js.map +1 -1
  30. package/dist/layers/axes/axesLayer.js +11 -4
  31. package/dist/layers/axes/axesLayer.js.map +1 -1
  32. package/dist/layers/axes/boxLayer.js +17 -10
  33. package/dist/layers/axes/boxLayer.js.map +1 -1
  34. package/dist/layers/axes2d/axes2DLayer.js +56 -32
  35. package/dist/layers/axes2d/axes2DLayer.js.map +1 -1
  36. package/dist/layers/colormap/colormapLayer.js +33 -34
  37. package/dist/layers/colormap/colormapLayer.js.map +1 -1
  38. package/dist/layers/crosshair/crosshairLayer.js +2 -2
  39. package/dist/layers/crosshair/crosshairLayer.js.map +1 -1
  40. package/dist/layers/drawing/drawingLayer.js +6 -4
  41. package/dist/layers/drawing/drawingLayer.js.map +1 -1
  42. package/dist/layers/fault_polygons/faultPolygonsLayer.js +5 -6
  43. package/dist/layers/fault_polygons/faultPolygonsLayer.js.map +1 -1
  44. package/dist/layers/gpglLayers/gpglValueMappedSurfaceLayer.js +194 -168
  45. package/dist/layers/gpglLayers/gpglValueMappedSurfaceLayer.js.map +1 -1
  46. package/dist/layers/grid3d/grid3dLayer.js +46 -53
  47. package/dist/layers/grid3d/grid3dLayer.js.map +1 -1
  48. package/dist/layers/grid3d/privateGrid3dLayer.js +73 -48
  49. package/dist/layers/grid3d/privateGrid3dLayer.js.map +1 -1
  50. package/dist/layers/grid3d/webworker.js +17 -6
  51. package/dist/layers/grid3d/webworker.js.map +1 -1
  52. package/dist/layers/hillshading2d/hillshading2dLayer.js +15 -9
  53. package/dist/layers/hillshading2d/hillshading2dLayer.js.map +1 -1
  54. package/dist/layers/index.d.ts +2 -0
  55. package/dist/layers/index.js +1 -0
  56. package/dist/layers/index.js.map +1 -1
  57. package/dist/layers/map/mapLayer.js +49 -50
  58. package/dist/layers/map/mapLayer.js.map +1 -1
  59. package/dist/layers/map/privateMapLayer.js +52 -28
  60. package/dist/layers/map/privateMapLayer.js.map +1 -1
  61. package/dist/layers/map/webworker.js +1 -1
  62. package/dist/layers/map/webworker.js.map +1 -1
  63. package/dist/layers/northarrow/northArrow3DLayer.js +17 -10
  64. package/dist/layers/northarrow/northArrow3DLayer.js.map +1 -1
  65. package/dist/layers/piechart/pieChartLayer.js +26 -21
  66. package/dist/layers/piechart/pieChartLayer.js.map +1 -1
  67. package/dist/layers/points/pointsLayer.js +5 -3
  68. package/dist/layers/points/pointsLayer.js.map +1 -1
  69. package/dist/layers/points/privatePointsLayer.js +1 -2
  70. package/dist/layers/points/privatePointsLayer.js.map +1 -1
  71. package/dist/layers/polyline_group/polylineGroupLayer.d.ts +239 -0
  72. package/dist/layers/polyline_group/polylineGroupLayer.js +674 -0
  73. package/dist/layers/polyline_group/polylineGroupLayer.js.map +1 -0
  74. package/dist/layers/polylines/polylinesLayer.d.ts +4 -0
  75. package/dist/layers/polylines/polylinesLayer.js +9 -3
  76. package/dist/layers/polylines/polylinesLayer.js.map +1 -1
  77. package/dist/layers/polylines/privatePolylinesLayer.js +1 -2
  78. package/dist/layers/polylines/privatePolylinesLayer.js.map +1 -1
  79. package/dist/layers/seismic/seismicLayer.js +28 -23
  80. package/dist/layers/seismic/seismicLayer.js.map +1 -1
  81. package/dist/layers/shader_modules/phong-lighting/phong-material.js +2 -2
  82. package/dist/layers/shader_modules/phong-lighting/phong-material.js.map +1 -1
  83. package/dist/layers/shader_modules/test-precision/precisionForTests-shaders-glsl.js +4 -3
  84. package/dist/layers/shader_modules/test-precision/precisionForTests-shaders-glsl.js.map +1 -1
  85. package/dist/layers/triangle/privateTriangleLayer.js +66 -40
  86. package/dist/layers/triangle/privateTriangleLayer.js.map +1 -1
  87. package/dist/layers/triangle/triangleLayer.js +66 -66
  88. package/dist/layers/triangle/triangleLayer.js.map +1 -1
  89. package/dist/layers/utils/colormapTools.js +16 -3
  90. package/dist/layers/utils/colormapTools.js.map +1 -1
  91. package/dist/layers/utils/layerTools.js +5 -7
  92. package/dist/layers/utils/layerTools.js.map +1 -1
  93. package/dist/layers/well_markers/wellMarkersLayer.js +41 -16
  94. package/dist/layers/well_markers/wellMarkersLayer.js.map +1 -1
  95. package/dist/layers/wells/layers/dashedSectionsPathLayer.js +60 -31
  96. package/dist/layers/wells/layers/dashedSectionsPathLayer.js.map +1 -1
  97. package/dist/layers/wells/layers/flatWellMarkersLayer.js +79 -33
  98. package/dist/layers/wells/layers/flatWellMarkersLayer.js.map +1 -1
  99. package/dist/layers/wells/layers/logCurveLayer.js +80 -69
  100. package/dist/layers/wells/layers/logCurveLayer.js.map +1 -1
  101. package/dist/layers/wells/layers/mergedTextLayer.js +18 -12
  102. package/dist/layers/wells/layers/mergedTextLayer.js.map +1 -1
  103. package/dist/layers/wells/layers/wellLabelLayer.js +20 -13
  104. package/dist/layers/wells/layers/wellLabelLayer.js.map +1 -1
  105. package/dist/layers/wells/utils/abscissaTransform.js +10 -4
  106. package/dist/layers/wells/utils/abscissaTransform.js.map +1 -1
  107. package/dist/layers/wells/utils/features.js +2 -4
  108. package/dist/layers/wells/utils/features.js.map +1 -1
  109. package/dist/layers/wells/utils/log.js +11 -11
  110. package/dist/layers/wells/utils/log.js.map +1 -1
  111. package/dist/layers/wells/utils/readout.js +2 -4
  112. package/dist/layers/wells/utils/readout.js.map +1 -1
  113. package/dist/layers/wells/utils/spline.js +19 -25
  114. package/dist/layers/wells/utils/spline.js.map +1 -1
  115. package/dist/layers/wells/utils/trajectory.js +28 -22
  116. package/dist/layers/wells/utils/trajectory.js.map +1 -1
  117. package/dist/layers/wells/utils/wells.js +3 -4
  118. package/dist/layers/wells/utils/wells.js.map +1 -1
  119. package/dist/layers/wells/wellsLayer.js +232 -138
  120. package/dist/layers/wells/wellsLayer.js.map +1 -1
  121. package/dist/utils/BoundingBox2D.js +2 -2
  122. package/dist/utils/BoundingBox2D.js.map +1 -1
  123. package/dist/utils/BoundingBox3D.js +2 -2
  124. package/dist/utils/BoundingBox3D.js.map +1 -1
  125. package/dist/utils/Color.js +2 -3
  126. package/dist/utils/Color.js.map +1 -1
  127. package/dist/utils/camera.js +3 -5
  128. package/dist/utils/camera.js.map +1 -1
  129. package/dist/utils/configuration.d.ts +5 -5
  130. package/dist/utils/configuration.js +7 -2
  131. package/dist/utils/configuration.js.map +1 -1
  132. package/dist/utils/event.js +7 -7
  133. package/dist/utils/event.js.map +1 -1
  134. package/dist/utils/serialize.js +52 -68
  135. package/dist/utils/serialize.js.map +1 -1
  136. package/dist/utils/specExtractor.js +1 -1
  137. package/dist/utils/specExtractor.js.map +1 -1
  138. package/dist/views/sectionView.js +1 -1
  139. package/dist/views/sectionView.js.map +1 -1
  140. package/dist/views/viewport.d.ts +1 -0
  141. package/dist/views/viewport.js +10 -4
  142. package/dist/views/viewport.js.map +1 -1
  143. package/package.json +15 -16
@@ -0,0 +1,239 @@
1
+ import type { Color, FilterContext, PickingInfo, UpdateParameters } from "@deck.gl/core";
2
+ import { CompositeLayer } from "@deck.gl/core";
3
+ import type { PathLayerProps } from "@deck.gl/layers";
4
+ import { PathLayer } from "@deck.gl/layers";
5
+ import type { Position } from "@deck.gl/core";
6
+ import type { Point2D } from "../..";
7
+ import type { ExtendedLayerProps, LayerPickInfo } from "../utils/layerTools";
8
+ export type PolylineStyle = {
9
+ color?: Color;
10
+ width?: number;
11
+ dashArray?: [number, number];
12
+ };
13
+ export type Polyline = PolylineStyle & {
14
+ id?: string | number;
15
+ /**
16
+ * The geometry of this polyline.
17
+ *
18
+ * - `Position[]` — a single connected path (the common case).
19
+ * - `PolylineGroup` — a set of disjoint segments that share the same logical
20
+ * identity (id, picking, visibility). Use this to represent a horizon that
21
+ * is cut by faults: each segment in `group.polylines` is a full `Polyline`
22
+ * and may carry its own `color`, `width`, and `dashArray` overrides, enabling
23
+ * per-segment highlighting. The parent `Polyline` acts as the logical owner.
24
+ *
25
+ * One level only — segment paths must be `Position[]`; nested `PolylineGroup`
26
+ * paths inside segments are not supported.
27
+ *
28
+ * `BinaryPolylines` inside the sub-group is not supported; use `Polyline[]`.
29
+ */
30
+ path: Position[] | PolylineGroup;
31
+ };
32
+ /**
33
+ * Binary format for high-performance rendering of large polyline sets.
34
+ * `positions` is a flat interleaved Float32Array: [x,y,z, x,y,z, ...].
35
+ * `startIndices` contains the vertex index where each polyline begins;
36
+ * the last polyline ends at the end of the positions array.
37
+ * Per-polyline color/width overrides are not supported — use group-level values.
38
+ *
39
+ * Optionally, `colors` (Uint8Array, RGBA, normalized, length = 4 * num vertices)
40
+ * and `widths` (Float32Array, length = num vertices) can be provided for per-vertex
41
+ * styling. If omitted, group-level color/width will be used for all vertices.
42
+ */
43
+ export type BinaryPolylines = {
44
+ positions: Float32Array;
45
+ startIndices: Uint32Array;
46
+ colors?: Uint8Array;
47
+ widths?: Float32Array;
48
+ };
49
+ export type PolylineGroup = PolylineStyle & {
50
+ id?: string | number;
51
+ name?: string;
52
+ polylines: Polyline[] | BinaryPolylines;
53
+ };
54
+ /**
55
+ * Props accepted by {@link PolylineGroupLayer}.
56
+ *
57
+ * Styling is resolved through a cascade for each rendered path:
58
+ * 1. polyline-level accessor (`getPolylineColor` / `getPolylineWidth` / `getPolylineDashArray`)
59
+ * 2. `Polyline` field (`color` / `width` / `dashArray`)
60
+ * 3. group-level accessor (`getGroupColor` / `getGroupWidth` / `getGroupDashArray`)
61
+ * 4. `PolylineGroup` field (`color` / `width` / `dashArray`)
62
+ * 5. layer default (`defaultGroupStyle`)
63
+ */
64
+ export interface PolylineGroupLayerProps extends ExtendedLayerProps, Pick<PathLayerProps, "widthUnits" | "widthScale" | "widthMinPixels" | "widthMaxPixels" | "jointRounded" | "capRounded" | "miterLimit" | "billboard"> {
65
+ /**
66
+ * Array of polyline groups. Each group holds a set of polylines and
67
+ * optional group-level color/width defaults.
68
+ */
69
+ data: PolylineGroup[];
70
+ /**
71
+ * Return an explicit color for all polylines in `group`.
72
+ * Takes precedence over `PolylineGroup.color`.
73
+ * Return `null` or `undefined` to fall through to the field value.
74
+ */
75
+ getGroupColor?: (group: PolylineGroup) => Color | null | undefined;
76
+ /**
77
+ * Return an explicit width for all polylines in `group`.
78
+ * Takes precedence over `PolylineGroup.width`.
79
+ * Return `null` or `undefined` to fall through to the field value.
80
+ */
81
+ getGroupWidth?: (group: PolylineGroup) => number | null | undefined;
82
+ /**
83
+ * Return an explicit color for an individual `polyline`.
84
+ * Takes precedence over the polyline's own `color` field and the group accessor.
85
+ * Return `null` or `undefined` to continue down the cascade.
86
+ */
87
+ getPolylineColor?: (polyline: Polyline, group: PolylineGroup) => Color | null | undefined;
88
+ /**
89
+ * Return an explicit width for an individual `polyline`.
90
+ * Takes precedence over the polyline's own `width` field and the group accessor.
91
+ * Return `null` or `undefined` to continue down the cascade.
92
+ */
93
+ getPolylineWidth?: (polyline: Polyline, group: PolylineGroup) => number | null | undefined;
94
+ /** Extract the polylines from a group object. Defaults to `g.polylines`. */
95
+ getGroupPolylines?: (group: PolylineGroup) => Polyline[] | BinaryPolylines;
96
+ /**
97
+ * Extract the path positions from a polyline object. Defaults to `p.path as Position[]`.
98
+ * Only called on leaf polylines whose `path` is `Position[]` (i.e. not on container
99
+ * polylines whose `path` is a `PolylineGroup`).
100
+ */
101
+ getPolylinePath?: (polyline: Polyline, group: PolylineGroup) => Position[];
102
+ /**
103
+ * Fallback style applied when no group or polyline style is resolved.
104
+ * Defaults to `{ color: [0, 128, 255, 255], width: 2 }`.
105
+ */
106
+ defaultGroupStyle?: PolylineStyle;
107
+ /**
108
+ * If true, input Z values are interpreted as depths (positive = down),
109
+ * so they are negated before rendering. Default: true.
110
+ */
111
+ ZIncreasingDownwards?: boolean;
112
+ /** Enable/disable depth testing when rendering layer. Default: true. */
113
+ depthTest?: boolean;
114
+ /**
115
+ * Set of group ids to hide. Groups not in the set remain visible.
116
+ * Uses GPU-side filtering — no re-flatten required when changed.
117
+ *
118
+ * @remarks Group ids can be defined using string or number. The set can
119
+ * contain a mix of both, but the type of ids in the set should match the
120
+ * type of `PolylineGroup.id` for correct filtering.
121
+ */
122
+ hiddenGroups?: Set<string | number>;
123
+ /**
124
+ * Set of polyline ids to hide. Only applies to polylines defined via
125
+ * the `Polyline[]` format (ids are unavailable in BinaryPolylines).
126
+ * Uses GPU-side filtering — no re-flatten required when changed.
127
+ *
128
+ * @remarks Polyline ids can be defined using string or number. The set can
129
+ * contain a mix of both, but the type of ids in the set should match the
130
+ * type of `Polyline.id` for correct filtering.
131
+ */
132
+ hiddenPolylines?: Set<string | number>;
133
+ /**
134
+ * Return a `[dashLength, gapLength]` dash pattern for all polylines in `group`.
135
+ * Providing this accessor (even for some groups) activates `PathStyleExtension`
136
+ * for the entire layer. Return `null` or `undefined` to fall through to the field value.
137
+ */
138
+ getGroupDashArray?: (group: PolylineGroup) => [number, number] | null | undefined;
139
+ /**
140
+ * Return a `[dashLength, gapLength]` dash pattern for an individual `polyline`,
141
+ * overriding the group-level pattern.
142
+ * Return `null` or `undefined` to continue down the cascade.
143
+ */
144
+ getPolylineDashArray?: (polyline: Polyline, group: PolylineGroup) => [number, number] | null | undefined;
145
+ /**
146
+ * Use high-precision dash rendering (avoids dash-length variation at segment
147
+ * joins). Slightly more expensive. Default: false.
148
+ */
149
+ highPrecisionDash?: boolean;
150
+ /**
151
+ * Path of the cross-section fence as 2-D world-space XY coordinates `[x, y]`.
152
+ * When provided, each polyline path point is interpreted as
153
+ * `[abscissa, depth]` where `abscissa` is the cumulative distance along this fence.
154
+ *
155
+ * - In a `SectionView` viewport the paths are rendered in abscissa/depth space.
156
+ * - In a 3D viewport the abscissa values are projected back onto the fence.
157
+ *
158
+ * @remarks Pass a stable reference (module-level or memoized constant) to avoid
159
+ * unnecessary re-computation of the section index.
160
+ */
161
+ sectionPath?: Point2D[];
162
+ }
163
+ /**
164
+ * A deck.gl {@link CompositeLayer} that renders collections of polylines
165
+ * organised into named groups.
166
+ *
167
+ * **Data formats**
168
+ *
169
+ * Each {@link PolylineGroup} holds one or more polylines. Two formats are
170
+ * supported for `PolylineGroup.polylines`:
171
+ * - `Polyline[]` — per-object format; supports `id`, and per-polyline `color`,
172
+ * `width`, and `dashArray` overrides.
173
+ * - {@link BinaryPolylines} — flat typed-array format; more efficient for
174
+ * large datasets loaded from binary sources. Group-level styling only.
175
+ *
176
+ * **Discontinuous polylines**
177
+ *
178
+ * A `Polyline.path` may be a nested {@link PolylineGroup}, making one logical
179
+ * polyline consist of disjoint segments (e.g. a seismic horizon cut by faults).
180
+ * All segments share the root `Polyline.id` for picking and visibility filtering.
181
+ *
182
+ * **Styling cascade**
183
+ *
184
+ * Color, width, and dash pattern are resolved per-path in this order:
185
+ * polyline accessor → `Polyline` field → group accessor → `PolylineGroup` field
186
+ * → layer default prop.
187
+ *
188
+ * **Section-view projection**
189
+ *
190
+ * When {@link PolylineGroupLayerProps.sectionPath} is provided, path coordinates
191
+ * are interpreted as `[abscissa, depth]`. The layer renders two sub-layers:
192
+ * one in abscissa/depth space for {@link SectionViewport}s, and one with
193
+ * abscissa values projected back to world XY for 3-D viewports.
194
+ *
195
+ * **GPU-side visibility**
196
+ *
197
+ * {@link PolylineGroupLayerProps.hiddenGroups} and
198
+ * {@link PolylineGroupLayerProps.hiddenPolylines} use `DataFilterExtension`.
199
+ * Changing these sets triggers only a GPU attribute update; the flattened
200
+ * data buffer is never rebuilt.
201
+ */
202
+ export declare class PolylineGroupLayer extends CompositeLayer<PolylineGroupLayerProps> {
203
+ /** @override Builds the initial flat data buffer and section index from `props.data`. */
204
+ initializeState(): void;
205
+ /**
206
+ * @override
207
+ * Rebuilds the flat data buffer when `data` or any accessor/default prop changes.
208
+ * Rebuilds the section index when `sectionPath` changes.
209
+ */
210
+ updateState({ props, oldProps, }: UpdateParameters<PolylineGroupLayer>): void;
211
+ /**
212
+ * @override
213
+ * Routes the `paths-section` sub-layer to {@link SectionViewport}s and
214
+ * the `paths-3d` sub-layer to all other viewports.
215
+ * Only active when `sectionPath` is set; otherwise the single `paths` sub-layer
216
+ * is always visible.
217
+ */
218
+ filterSubLayer({ layer, viewport }: FilterContext): boolean;
219
+ /**
220
+ * @override
221
+ * Returns one or more `PathLayer` sub-layers.
222
+ * - Without `sectionPath`: a single `paths` sub-layer for non-binary groups,
223
+ * plus a single `paths-binary` sub-layer that merges all binary groups into
224
+ * combined typed-array buffers and passes them straight to the GPU.
225
+ * - With `sectionPath`: a `paths-section` sub-layer (abscissa/depth space)
226
+ * and a `paths-3d` sub-layer (world XY space), routed by {@link filterSubLayer}.
227
+ * Binary groups are not supported in section mode and are skipped with a warning.
228
+ */
229
+ renderLayers(): PathLayer[];
230
+ /**
231
+ * @override
232
+ * Enriches the pick result with the originating {@link PolylineGroup} (`info.group`),
233
+ * the root {@link Polyline} (`info.object`), and layer properties for display
234
+ * (group name, polyline id, depth at the picked coordinate).
235
+ */
236
+ getPickingInfo({ info }: {
237
+ info: PickingInfo;
238
+ }): LayerPickInfo;
239
+ }