@welldot/render 0.2.2 → 0.3.0-next.20261014.26249fd
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/LICENSE +202 -0
- package/README.md +71 -14
- package/dist/chunk-ODRL222Y.js +10 -0
- package/dist/chunk-ODRL222Y.js.map +1 -0
- package/dist/index.cjs +1493 -325
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +332 -33
- package/dist/index.d.ts +332 -33
- package/dist/index.js +1501 -331
- package/dist/index.js.map +1 -1
- package/dist/textures.cjs +339 -0
- package/dist/textures.cjs.map +1 -0
- package/dist/textures.d.cts +9 -0
- package/dist/textures.d.ts +9 -0
- package/dist/textures.js +7 -0
- package/dist/textures.js.map +1 -0
- package/package.json +11 -6
- package/LICENCE.md +0 -179
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2024 Rafael Neto
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -35,12 +35,27 @@ Call `prepareSvg()` once after mounting the SVG element, then call `draw(profile
|
|
|
35
35
|
## What it renders
|
|
36
36
|
|
|
37
37
|
- **Lithology column** — geological layers with FGDC standard texture patterns and custom fill colors
|
|
38
|
-
- **Construction** — borehole, well casings, diameter reductions, well screens, hole fills (gravel pack / cement seal), and cement pad
|
|
38
|
+
- **Construction** — borehole, well casings, diameter reductions, well screens, hole fills (gravel pack / cement seal), centralizers (`.well` v2.1 — bow markers in the annulus at each derived position; size via `renderConfig.construction.centralizer.markerHalfHeight`, colors via `theme.centralizer`, tooltip key `centralizer`), and cement pad. Pipes and the borehole are drawn **open**: walls only, never closed at panel cuts (a `depthRange` that splits an item) or at joints between casing, screen and reduction. They close only where they physically end:
|
|
39
|
+
- **Casing shoe** — a filled triangle outside each wall at the bottom of the casing / screen string (`renderConfig.construction.casingShoe`: `active`, `size` px, kept within the annulus).
|
|
40
|
+
- **Screen ends** — a thin dashed line across the pipe at the top and base of every screen, marking the slotted section's limits (`renderConfig.construction.screenEnds.active`; style via `theme.wellScreen.endStrokeWidth` / `endDasharray`; none at panel cuts).
|
|
41
|
+
- **Borehole** — a bottom line at total depth and a shoulder where the diameter changes; the mouth stays open.
|
|
42
|
+
- **Hole fill** — the material fills only the annulus (the pipe is cut out of it), with a line at each interface with another material or the open hole.
|
|
43
|
+
- **Reduction** — two slanted walls.
|
|
44
|
+
- **Cement pad** — two slabs resting on the surface, one on each side of the outermost pipe (surface case, else casing or screen, else borehole), with a concrete texture (`renderConfig.textures.pad`) and break lines at the outer ends marking it as not to scale. Its size is fixed in px: `renderConfig.construction.cementPad.widthRatio` × the construction column width (widened to keep 1.5 × `height` px of slab beside the opening), `height` px tall. The profile's pad width and thickness only show in the tooltip.
|
|
45
|
+
- **Current pump** (`.well` v2.3 `pump_installations`) — the installation without `removed_at` (via `getCurrentPump` from `@welldot/utils`), drawn as a riser pipe from the wellhead and a pump body ending at `intake_depth`. The riser rises to the top of a casing sticking up above the ground, else to the cement pad, and ends there on a break line (it goes on to the discharge line); on a later panel it runs from the panel top. The riser uses `riser_diameter`, falling back to `riserWidthRatio` × casing diameter; riser and body are shrunk when needed to fit inside the casing (the body at most 85 % of the pipe at the intake, the riser at most 70 % of the narrowest pipe above it and narrower than the body). Configure via `renderConfig.construction.pump` (`active`, `bodyHeight` px, `bodyWidthRatio`, `riserWidthRatio`), colors via `theme.pump` (`fill`, `stroke`, `strokeWidth`, `riserFill`, `riserStroke`, `riserStrokeWidth`; the riser is a filled bar so it never reads as a casing), tooltip key `pump` (rated power shown in `units.power`: `kW`, `cv` or `hp`), legend label `legend.labels.pump`. Earlier installations are not drawn
|
|
39
46
|
- **Fractures** — individual and swarm fractures with dip angles and water-intake indicators
|
|
40
47
|
- **Caves** — cavity zones with wavy geological contact lines
|
|
41
|
-
- **Labels** — depth annotations, lithology descriptions, and geologic / aquifer unit strips
|
|
48
|
+
- **Labels** — depth annotations, lithology descriptions, and geologic / aquifer unit strips. `renderConfig.labels.lithology` also takes `'units'` (bold geologic unit, italic aquifer unit), `'swatch'` (the layer's fill before its depth range) and `'rules'` (a rule above each annotation). With `labels.continuation.active`, a layer that starts above the panel reads `↑ {prefix} · from–to` and a construction label of an item that starts above it gets a leading `↑`
|
|
49
|
+
- **Construction labels** — `renderConfig.constructionLabels.side`: `'left'` (default, each label next to its own casing wall) or `'right'` (one column starting `xOffset` px right of the construction, each label at its item's top)
|
|
42
50
|
- **Legend** — standalone legend panel for fracture and cave symbols
|
|
43
51
|
|
|
52
|
+
Opt-in layers, all off by default (mostly for paged/static output such as `@welldot/pdf`):
|
|
53
|
+
|
|
54
|
+
- **Column titles** (`renderConfig.columnHeaders`) — depth, lithology, construction and (with description annotations) description titles in the top margin, over a rule kept `construction.cementPad.height` px above the drawing. Labels come from `applyRenderLocale` (`PROF.` / `LIT.` / `CONSTRUÇÃO` / `DESCRIÇÃO GEOLÓGICA`); style via `theme.columnHeaders`
|
|
55
|
+
- **Mini-map** (`renderConfig.overview: { active, x, width, height }`) — the whole well's lithology (layer `color`s) as a thin column in the left margin, with a window outlining the panel's depth range; style via `theme.overview`
|
|
56
|
+
- **Markers** (`renderConfig.markers: { lithology, fractures, radius }`) — a circled 1-based index on each lithology layer (repeated on every panel the layer crosses) and `F{n}` next to each fracture, numbered by position in the profile's arrays; style via `theme.markers`
|
|
57
|
+
- **Overlap band** — a panel with `repeatedTo` (see `SvgInstance`) hatches `[depthRange[0], repeatedTo]` and labels it with `renderConfig.overlap.label` (`{range}` → `116–124 m`); style via `theme.overlap`
|
|
58
|
+
|
|
44
59
|
Supports zoom, pan, interactive tooltips, multi-panel layout for long wells, and configurable highlights for interactive selection.
|
|
45
60
|
|
|
46
61
|
---
|
|
@@ -65,7 +80,7 @@ new WellRenderer(svgs: SvgInstance[], options?: {
|
|
|
65
80
|
|
|
66
81
|
| Option | Type | Description |
|
|
67
82
|
| -------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
-
| `svgs` | `SvgInstance[]` | One or more SVG panel descriptors (`{ selector, height, width, margins }
|
|
83
|
+
| `svgs` | `SvgInstance[]` | One or more SVG panel descriptors (`{ selector, height, width, margins, depthRange?, repeatedTo? }`, see below) |
|
|
69
84
|
| `renderConfig` | `DeepPartial<RenderConfig>` | Controls zoom, pan, animation, labels, tooltips, layout |
|
|
70
85
|
| `theme` | `DeepPartial<WellTheme>` | Visual style overrides (merged with `DEFAULT_WELL_THEME`) |
|
|
71
86
|
| `units` | `Units` | `{ length: 'm' \| 'ft'; diameter: 'mm' \| 'inches' }` |
|
|
@@ -74,16 +89,38 @@ new WellRenderer(svgs: SvgInstance[], options?: {
|
|
|
74
89
|
| `onError` | `(err: Error) => void` | Error callback |
|
|
75
90
|
| `onZoom` | `(scale: number) => void` | Called with the current zoom scale (`1` = initial/fit) on every wheel/drag zoom-pan tick, and on `zoomBy`/`resetZoom` calls |
|
|
76
91
|
|
|
92
|
+
#### Panels
|
|
93
|
+
|
|
94
|
+
By default `draw()` splits the depth `[top, deepest]` across the panels in proportion to their `height`, back to back. `top` is `0` (the surface), or the negative `from` of a casing, screen or surface case that sticks up above the ground: the stick-up is drawn to scale above the cement pad and the lithology still starts at 0 m. `getProfileTopDepth(profile)` returns it, for consumers that plan their own `depthRange`s (start the first one there). Give **every** panel a `depthRange: [from, to]` (m) to choose each window yourself — panels may then overlap, e.g. to repeat the bottom of the previous page. `repeatedTo` (m) marks the repeated band `[from, repeatedTo]`, which is hatched and labelled.
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
new WellRenderer([
|
|
98
|
+
{ selector: '#p1', height: 600, width: 480, margins, depthRange: [0, 124] },
|
|
99
|
+
{
|
|
100
|
+
selector: '#p2',
|
|
101
|
+
height: 700,
|
|
102
|
+
width: 480,
|
|
103
|
+
margins,
|
|
104
|
+
depthRange: [116, 292],
|
|
105
|
+
repeatedTo: 124,
|
|
106
|
+
},
|
|
107
|
+
]);
|
|
108
|
+
```
|
|
109
|
+
|
|
77
110
|
#### Methods
|
|
78
111
|
|
|
79
|
-
| Method | Description
|
|
80
|
-
| ------------------------------------------------------------------------------------------------------------------ |
|
|
81
|
-
| `prepareSvg(): Promise<void>` | Initialise SVG DOM structure and preload FGDC textures. Call once before the first `draw`.
|
|
82
|
-
| `draw(profile: RenderableWell, options?: { units?: Units; locale?: 'en' \| 'pt'; highlights?: Highlights }): void` | Render or re-render the full well profile.
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
112
|
+
| Method | Description |
|
|
113
|
+
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
|
|
114
|
+
| `prepareSvg(): Promise<void>` | Initialise SVG DOM structure and preload FGDC textures. Call once before the first `draw`. |
|
|
115
|
+
| `draw(profile: RenderableWell, options?: { units?: Units; locale?: 'en' \| 'pt'; highlights?: Highlights }): void` | Render or re-render the full well profile. Layers the profile no longer has are removed; an empty well clears the panels. |
|
|
116
|
+
| `clear(): void` | Remove everything drawn on every panel, keeping the `prepareSvg` structure (the next `draw` needs no new `prepareSvg`). |
|
|
117
|
+
| `renderLegend(selector: string, profile: Well): void` | Render a standalone legend into a separate SVG. |
|
|
118
|
+
| `getLegendItems(profile: Well): WellLegendItem[]` | List the legend entries the profile needs, labeled from `renderConfig.legend.labels`. |
|
|
119
|
+
| `renderLegendSymbol(selector: string, item: WellLegendItem): void` | Render one entry's symbol into its own SVG, with the textures it uses defined inside (e.g. for a PDF table). |
|
|
120
|
+
| `renderLithologySwatch(selector: string, layer: Lithology, size = 10): void` | Render one lithology layer's fill as a `size`×`size` square into its own SVG, texture defined inside. After `prepareSvg`. |
|
|
121
|
+
| `zoomBy(factor: number): void` | Multiply the current zoom scale by `factor` (e.g. `1.25` in, `1 / 1.25` out). No-op if `zoom`/`pan` are both disabled. |
|
|
122
|
+
| `resetZoom(): void` | Reset zoom/pan back to `renderConfig.zoomLevel` (default `1` — the initial fit-to-container view). |
|
|
123
|
+
| `getZoomScale(): number` | Current zoom scale of the first panel (`1` = initial/fit). |
|
|
87
124
|
|
|
88
125
|
`RenderableWell` extends `Well` with an optional `key` field on each feature array element, enabling stable D3 data-join keys across re-renders. A plain `Well` object is directly assignable to `RenderableWell`. **`key` is runtime-only** — keep it in memory across edits for stable animation, but strip it before serializing to a `.well` file.
|
|
89
126
|
|
|
@@ -121,7 +158,27 @@ drawWellLegend(
|
|
|
121
158
|
): void
|
|
122
159
|
```
|
|
123
160
|
|
|
124
|
-
|
|
161
|
+
Sets the SVG to `0×0` if the profile needs no legend entry.
|
|
162
|
+
|
|
163
|
+
### `getWellLegendItems` / `drawWellLegendSymbol`
|
|
164
|
+
|
|
165
|
+
Build your own legend layout (a table, an HTML list…) instead of the fixed SVG panel.
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
getWellLegendItems(profile: Well, labels?: LegendRenderConfig['labels']): WellLegendItem[]
|
|
169
|
+
|
|
170
|
+
drawWellLegendSymbol(
|
|
171
|
+
selector: string,
|
|
172
|
+
item: WellLegendItem,
|
|
173
|
+
options?: {
|
|
174
|
+
theme?: Partial<WellTheme>;
|
|
175
|
+
classNames?: ComponentsClassNames['legend'];
|
|
176
|
+
textures?: TexturesConfig;
|
|
177
|
+
}
|
|
178
|
+
): void
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`getWellLegendItems` returns the entries in display order; each has a `key` (a `LegendRenderConfig['labels']` key such as `boreHole` or `fractureSwarm`) and its `label`. `drawWellLegendSymbol` draws one entry's symbol (24×12 px plus a 2 px margin, i.e. a `28×16` SVG) with every texture defined inside, so its `outerHTML` renders on its own.
|
|
125
182
|
|
|
126
183
|
---
|
|
127
184
|
|
|
@@ -143,7 +200,7 @@ Does nothing if the profile contains no fractures or caves.
|
|
|
143
200
|
| `formatDiameter` | `(mm: number, units: DiameterUnits) => string` | Diameter in mm → unit-aware string |
|
|
144
201
|
| `getLengthUnit` | `(units: LengthUnits) => string` | Returns `'m'` or `'ft'` |
|
|
145
202
|
| `getDiameterUnit` | `(units: DiameterUnits, locale?: 'en' \| 'pt') => string` | Returns `'mm'`, or `'"'`/`'in.'` for `inches` depending on `locale` (defaults to `'"'`) |
|
|
146
|
-
| `resolveRenderLabel` | `(value: RenderLocalizedText, locale: 'en' \| 'pt') => string` | Resolves a
|
|
203
|
+
| `resolveRenderLabel` | `(value: RenderLocalizedText, locale: 'en' \| 'pt') => string` | Resolves a label (core `resolveLanguageText` with `pt` as fallback) to a plain string |
|
|
147
204
|
|
|
148
205
|
---
|
|
149
206
|
|
|
@@ -165,7 +222,7 @@ const renderer = new WellRenderer(svgs, {
|
|
|
165
222
|
});
|
|
166
223
|
```
|
|
167
224
|
|
|
168
|
-
`applyRenderLocale(config, locale)` returns a copy of `config` with `constructionLabels.labels`, `legend.labels`, `tooltipLabels`,
|
|
225
|
+
`applyRenderLocale(config, locale)` returns a copy of `config` with `constructionLabels.labels`, `legend.labels`, `tooltipLabels`, `labels.typeLabels`, `labels.continuation.prefix`, `columnHeaders.labels` and `overlap.label` resolved from the package's canonical `RENDER_LABELS` pack — every other field of `config` is unchanged. `RENDER_LABELS` (and the `RenderLocalizedText` — a core `LanguageText<'pt'>` or a plain string —/`RenderLabelPack`/`TooltipLabels` types describing its shape) are also exported directly for consumers who want to resolve labels themselves. Omitting `locale`/`applyRenderLocale` entirely preserves the package's historical Portuguese-only output.
|
|
169
226
|
|
|
170
227
|
---
|
|
171
228
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/fgdcTextures.ts"],"sourcesContent":["import { TextureCode } from '@welldot/core';\n\n/**\n * Dynamically imports the FGDC texture registry (SVG path data keyed by texture code).\n * Useful for external UIs that need to display texture thumbnails in selection controls.\n */\nexport async function importFgdcTextures(): Promise<{\n [code: TextureCode]: string;\n}> {\n const fgdcTextures = await import('../data/fgdcTextures.json');\n return fgdcTextures.default as { [code: TextureCode]: string };\n}\n"],"mappings":";AAMA,eAAsB,qBAEnB;AACD,QAAM,eAAe,MAAM,OAAO,4BAA2B;AAC7D,SAAO,aAAa;AACtB;","names":[]}
|